我正在尝试从一个驱动器共享点下载文件,但是即使我也提供了我的凭据,但它仍然抛出类似“远程服务器返回未经授权的错误401的错误”,但又出现了同样的错误。谁能帮我解决这个问题?
WebClient client1 = new WebClient();
client1.UseDefaultCredentials = true;
client1.Credentials = CredentialCache.DefaultCredentials;
client1.Credentials = new NetworkCredential("Username", "Pwd");
client1.DownloadFile(uri1, Afilename1);