WebClient DefaultCredentials 和 NetworkCredentials 之间有什么区别?
由于某种原因,我以前使用 DefaultCredentials
工作的 WebClient 应用程序现在给我一个 401 Unauthorized。使用具有完全相同的 ID 和 PW 的 NetworkCredentials 可以正常工作。
网络服务器上肯定发生了一些变化,但我无法控制它。我只是觉得很奇怪,DefaultCredentials
和 NetworkCredentials
之间存在差异。
可能有什么区别以及如何调试?
For some reason my WebClient app that used to work using DefaultCredentials
now gives me a 401 Unauthorized. Using NetworkCredentials
with the exact same ID and PW works.
Something must have changed on the web server, but I have no control of that. I just find it strange that there is a difference between DefaultCredentials
and NetworkCredentials
.
What could possibly be the difference and how to debug?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您阅读了 msdn 文章 和这篇文章吗?
他们说 DefaultCredentials 代表本地用户的凭据。但我无法回答你为什么它在过去有效。用户名和密码和以前一样吗?
或者您的意思是另一个属性 WebClient.Credentials ?
Did you read the msdn article and this?
They say DefaultCredentials represents the credentials of the local user. But I cannot answer you why it was working in the past. Username and password is the same like in the past?
Or do you mean another property as WebClient.Credentials ?