读书人

WebClient DownloadFileAsync发布到服

发布时间: 2012-03-22 17:43:57 作者: rapoo

WebClient DownloadFileAsync发布到服务器上不行。
WebClient DownloadFileAsync方法 在本地调试可以,发布到服务器上就不行了。
代码:
WebClient client = new WebClient();
client.DownloadFileAsync(new Uri(urlstr), @"F:\qq.xls");


不明白为什么 请高人指教啊。

[解决办法]
看下用户权限
[解决办法]
你是asp.net 里面吗?
你必须使用
WebClient client = new WebClient();
client.DownloadFileAsync(new Uri(urlstr), Server.MapPath("~/xx.xsl"));

或者
WebClient client = new WebClient();
client.DownloadFile(urlstr, Server.MapPath("~/xx.xsl"));

读书人网 >C#

热点推荐