c#中有关webClient.DownloadFile(string,string);的问题

c#中有关webClient.DownloadFile(string,string);的问题
这个方法我查了下MSDN,说第一个string参数为address ,是从中下载数据的 URI。这个好理解,但第二个是说是fileName,即要接收数据的本地文件的名称,我就想问,这个fileName是我本地文件夹得名称吗?我试着写 了段代码: WebClient webClient = new WebClient(); webClient.DownloadFile("
,", @"E:\新建文件夹"); 可是出现的异常老说"E:\新建文件夹被拒绝访问“。在网上查了段代码,如下: WebClient webClient = new WebClient(); webClient.DownloadFile(this.openFileDialog1.FileName,“imageName ”); 貌似这个fileName就只是个用来代替下载文件的名字的字符串。我这就糊涂了,这个文件到底下载到哪了啊?跪求指教啊!!!
第二个参数时文件名,就是你下载的那个文件,你必须给它指定一个文件名。
Try this,

1. take out extra comma in your first string after .jpg
2. use "E:\团谈纳\yourimagename"塌没 instead of @"..."侍孝
← 上一篇: 下一篇: →