Download a file in C#

2009/10/26

Easy task !
Import the System.Net namespace and after that use the DownloadFile method of the WebClient class:

public void DownloadFile(string link, string destination)
{
    using (WebClient webClient = new WebClient())
    {
        webClient.DownloadFile(link, destination);
    }
}

%d bloggers like this: