WebClient.UseDefaultCredentials Property

July 28, 2014

Gets or sets a Boolean value that controls whether default credentials are sent with requests.

Namespace:  System.Net
Assembly:  System.Net (in System.Net.dll)

public bool UseDefaultCredentials { get; set; }

Property Value

Type: System.Boolean
true if the default credentials are used; otherwise false. The default value is true.

Set this property to true when requests made by this WebClient 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 applications that wish to control the authentication user experience, instead of using this property you would typically set the Credentials property to the credentials of the client on whose behalf the request is made.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft