WebClient DownloadFileAsync方法 在本地调试可以,发布到服务器上就不行了。
代码:
WebClient client = new WebClient();
client.DownloadFileAsync(new Uri(urlstr), @"F:\qq.xls");
不明白为什么 请高人指教啊。
代码:
WebClient client = new WebClient();
client.DownloadFileAsync(new Uri(urlstr), @"F:\qq.xls");
不明白为什么 请高人指教啊。
你是指 对url的用户权限 还是对电脑系统的用户权限?
你必须使用
WebClient client = new WebClient();
client.DownloadFileAsync(new Uri(urlstr), Server.MapPath("~/xx.xsl"));或者
WebClient client = new WebClient();
client.DownloadFile(urlstr, Server.MapPath("~/xx.xsl"));
httpClient.DownloadFileCompleted += new System.ComponentModel.AsyncCompletedEventHandler(AsyncDownloadFileCompleted);//AsyncDownloadFileCompleted方法,我想在这个方法里头再传递一个参数,该如何实现? void AsyncDownloadFileCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{
}
httpClient.DownloadFileCompleted += new System.ComponentModel.AsyncCompletedEventHandler(AsyncDownloadFileCompleted);
//AsyncDownloadFileCompleted方法,我想在这个方法里头再传递一个参数,该如何实现? void AsyncDownloadFileCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{
}