Skip to content

Instantly share code, notes, and snippets.

@talkingdotnet
Created February 27, 2018 05:48
Show Gist options
  • Save talkingdotnet/94b7fbea397dee5b26c22bcbbb6973c3 to your computer and use it in GitHub Desktop.
Save talkingdotnet/94b7fbea397dee5b26c22bcbbb6973c3 to your computer and use it in GitHub Desktop.
private bool DownloadFile(string url, string filePath)
{
bool bResult = true;
try
{
WebClient Client = new WebClient();
Client.DownloadFile(url, filePath);
WriteToConsole("File Downloaded successfully");
}
catch (Exception ex)
{
WriteToConsole("Error: DownloadFile()" + "\n" + ex.ToString());
bResult = false;
}
return bResult;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment