Export (0) Print
Expand All

WebProxy::Credentials Property

Gets or sets the credentials to submit to the proxy server for authentication.

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

public:
virtual property ICredentials^ Credentials {
	ICredentials^ get () sealed;
	void set (ICredentials^ value) sealed;
}

Property Value

Type: System.Net::ICredentials
An ICredentials instance that contains the credentials to submit to the proxy server for authentication.

Implements

IWebProxy::Credentials

ExceptionCondition
InvalidOperationException

You attempted to set this property when the UseDefaultCredentials property was set to true.

The Credentials property contains the authentication credentials to send to the proxy server in response to an HTTP 407 (proxy authorization) status code. In most client scenarios, you should use the DefaultCredentials, which are the credentials of the currently logged on user. To do this, set the UseDefaultCredentials property to true instead of setting this property.

NoteNote

If you set the Credentials property to credentials other than the DefaultCredentials, setting the UseDefaultCredentials property to true causes a InvalidOperationException. To prevent this, you must set the Credentials property to nullptr before setting the UseDefaultCredentials property to true. Likewise, you cannot set this property to any value when UseDefaultCredentials is true.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft