Gets or sets the credentials to submit to the proxy server for authentication.
Assembly: System (in System.dll)
public final function get Credentials () : ICredentials public final function set Credentials (value : ICredentials)
Property ValueType: System.Net.ICredentials
An ICredentials instance that contains the credentials to submit to the proxy server for authentication.
The 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.
If you set the property to credentials other than the DefaultCredentials, setting the UseDefaultCredentials property to true causes a InvalidOperationException. To prevent this, you must set the property to a null reference (Nothing in Visual Basic) before setting the UseDefaultCredentials property to true. Likewise, you cannot set this property to any value when UseDefaultCredentials is true.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.