Answers for "how to download file from web in c#"

C#
5

how to download file from url using c#

using (var client = new WebClient())
{
    client.DownloadFile("http://example.com/file/song/a.mpeg", "a.mpeg");
}
Posted by: Guest on September-22-2020
0

c# download file

string remoteUri = "http://www.contoso.com/library/homepage/images/";
string fileName = "ms-banner.gif", myStringWebResource = null;

// Create a new WebClient instance.
using (WebClient myWebClient = new WebClient())
{
    myStringWebResource = remoteUri + fileName;
    // Download the Web resource and save it into the current filesystem folder.
    myWebClient.DownloadFile(myStringWebResource, fileName);        
}
Posted by: Guest on May-07-2021

Code answers related to "how to download file from web in c#"

C# Answers by Framework

Browse Popular Code Answers by Language