Created
May 4, 2017 12:49
-
-
Save Boushhh/c3090447a95ff50fc50dd85927e513d1 to your computer and use it in GitHub Desktop.
Download from the internet C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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