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

cdownloadfile

What is a simple way of downloading a file from a URL path?

Best Answer

using (var client = new WebClient())
{
    client.DownloadFile("http://example.com/file/song/a.mpeg", "a.mpeg");
}