devxlogo

Using the WebClient Class to Download Data to a File

Using the WebClient Class to Download Data to a File

The following code shows how you can use the WebClient class to obtain data from a URL and save it to a file:

System.Net.WebClient client = new System.Net.WebClient();byte [] bytedata = client.DownloadData(url);client.DownloadFile(url,downloadPath);

devx-admin

Share the Post: