更新时间:2023-09-22 23:01:10
检查此链接
在asp.net中上传和下载文件 [ ^ ]
Check this link
file uploading and downloading in asp.net[^]
WebClient的位置位于using循环的底部.这可能会扼杀转让.尝试维护单个WebClient并通过它下载多个文件,或者自己使用WebRequests进行操作.
The WebClient''s getting disposed at the bottom of the using loop. That probably kills the transfer. Try maintaining a single WebClient and downloading multiple files through it, or do it yourself with WebRequests.
嘿,终于有了解决方案.
它通过添加凭据来解决.
webClient.Credentials =新的Net.NetworkCredential(用户名","pwd");
感谢所有人的答复
Hey All finally got solution.
It solved by adding credential.
webClient.Credentials = new Net.NetworkCredential("username","pwd");
Thanks to all for reply