C# – How to download a file from a website in C#

cdownloadwindows

Is it possible to download a file from a website in Windows Application form and put it into a certain directory?

Best Answer

With the WebClient class:

using System.Net;
//...
WebClient Client = new WebClient ();
Client.DownloadFile("http://i.stackoverflow.com/Content/Img/stackoverflow-logo-250.png", @"C:\folder\stackoverflowlogo.png");