首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

WebClient.DownloadFile的有关问题

2011-12-11 
WebClient.DownloadFile的问题WebClientmyWebClientnewWebClient()stringremoteUrihttp://localhost/g

WebClient.DownloadFile的问题
WebClient   myWebClient   =   new   WebClient();
string   remoteUri   =   "http://localhost/gis/ ";
string   filename= "a.txt "
string   myStringWebResource   =   remoteUri   +   filename;    
myWebClient.DownloadFile(myStringWebResource, "E:\\aaa\\ "+filename)     ;

代码运行无误,下载.mdb     .xls     .txt   .jpg可以,但是如果filename= "b.dll ",下载.dll就总出错了,显示远程服务器返回500错误什么的
谁给指点下,怎么才能让下载dll文件

还有上传,怎么才能上传这些格式的文件,myWebClient.UploadFile(myStringWebResource, "PUT ", "E:\\aaa\\ "+filename);     这个只有传txt不出问题,传别的要么报错,要么传过来哦的文件打不开。

万分感谢!

[解决办法]
你用ie去访问 'http://localhost/gis/x.dll '这个地址,就知道为什么不行了。

热点排行