WebClient下载文件

Posted 楚景然

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了WebClient下载文件相关的知识,希望对你有一定的参考价值。

 

public void DownDile(string url)
{

WebClient client = new WebClient();

string URLAddress = @"https://www.cnblogs.com/images/cnblogs_com/1439107348s/1295915/o_%e5%ad%a4%e7%8b%ac%e7%9a%84%e5%b7%a1%e7%a4%bc.jpg"; 

string receivePath = @"E:\\360ALl";
var downx= receivePath+@"\\"+ System.IO.Path.GetFileName(URLAddress);
client.DownloadFile(URLAddress,downx);

}

以上是关于WebClient下载文件的主要内容,如果未能解决你的问题,请参考以下文章