日期:2014-05-18  浏览次数:20841 次

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"));