News... | Hack-Acad | Downloads | Web-Projekte | System-Check | Kontakt
HACKACAD - C# - Download einer Datei

Download einer Datei im Internet:

 
 using System;
 using System.Net;
 using System.IO;

 namespace GetSaveFile
 {
    class Class1
    {
       static void Main(string[] args)
       {
         string remoteUri = "http://www.slaughterarts.de/header_gfx/sarts_header.jpg";
         string localFileName = "downloadedFile.jpg";

         WebClient client = new WebClient();
         Console.WriteLine("Download der Datei " + 
         remoteUri + " nach " + Path.GetFullPath(localFileName));

         // Download durchführen.
         client.DownloadFile(remoteUri, localFileName);
         Console.WriteLine("Download abgeschlossen.");

          Console.ReadLine();
 
       }
    }
 }