简体   繁体   中英

What's the difference between WebClient DefaultCredentials and 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?

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 ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM