Share via


Credentials Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets or sets authentication information for the request.

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

Syntax

'Declaration
Public Property Credentials As NetworkCredential
public NetworkCredential Credentials { get; set; }
public:
property NetworkCredential^ Credentials {
    NetworkCredential^ get ();
    void set (NetworkCredential^ value);
}
member Credentials : NetworkCredential with get, set
function get Credentials () : NetworkCredential
function set Credentials (value : NetworkCredential)

Property Value

Type: System.Net. . :: . .NetworkCredential
An ICredentials that contains the authentication credentials associated with the request. The default is nullNothingnullptrunita null reference (Nothing in Visual Basic).

Remarks

The Credentials property contains authentication information to identify the maker of the request. The Credentials property can be either a NetworkCredential, in which case the user, password, and domain information contained in the NetworkCredential object is used to authenticate the request, or it can be a CredentialCache, in which case the Uniform Resource Identifier (URI) of the request is used to determine the user, password, and domain information to use to authenticate the request.

.NET Framework Security

See Also

Reference

HttpWebRequest Class

System.Net Namespace