Skip to content

Instantly share code, notes, and snippets.

@Boushhh
Created May 4, 2017 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Boushhh/c3090447a95ff50fc50dd85927e513d1 to your computer and use it in GitHub Desktop.
Save Boushhh/c3090447a95ff50fc50dd85927e513d1 to your computer and use it in GitHub Desktop.
Download from the internet C#
public static void Download(string url, string save)
{
System.Net.WebClient webClient = new WebClient();
try
{
// Try to download the file.
webClient.DownloadFile(url, save);
Console.WriteLine("Downloaded the file.");
}
catch(Exception)
{
Console.WriteLine("Failed to download the file.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment