Gets or sets a bool value that controls whether the CredentialCache.DefaultCredentials are sent with requests.
Documentation for this section has not yet been entered.
Set this property to true when requests made by this System.Net.WebProxy object should, if requested by the server, be authenticated using the credentials of the currently logged on user. For client applications, this is the desired behavior in most scenarios. For middle tier applications, such as ASP.NET applications, instead of using this property, you would typically set the WebProxy.Credentials property to the credentials of the client on whose behalf the request is made.
The following table shows the effect of setting the WebProxy.UseDefaultCredentials value, based on the value of the WebProxy.Credentials property.
| CredentialCache.DefaultCredentials |
true |
No effect. |
| CredentialCache.DefaultCredentials |
false |
WebProxy.Credentials is set to null. |
| null |
true |
WebProxy.Credentials is set to CredentialCache.DefaultCredentials. |
| Any value other than CredentialCache.DefaultCredentials or null |
true or false |
Setting WebProxy.UseDefaultCredentials throws an exception. |
If WebProxy.UseDefaultCredentials is false, you can change the WebProxy.Credentials property to any credentials. If WebProxy.UseDefaultCredentials is true, changing the WebProxy.Credentials property from CredentialCache.DefaultCredentials (the value that is set when the WebProxy.UseDefaultCredentials property is set to true) will throw an exception.