How to simple download file in C# . NET System Net WebClient DownloadFile How to simple download file in C# . NET System Net WebClient DownloadFile How to simple download file in C# . NET System Net WebClient DownloadFile
static void Main(string[] args)
{
if (args.Length < 2)
{
Console.WriteLine("Usage: downloadfile [url] [localfile]");
return;
}
try
{
System.Net.WebClient client = new WebClient();
client.DownloadFile(args[0], args[1]);
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
};
}
How to simple download file in C# . NET System Net WebClient DownloadFile