public class NetworkCredential : ICredentials
Object
NetworkCredentialThis type implements ICredentials.
System
Networking
Provides credentials for password-based authentication.
The NetworkCredential class supplies client credentials used in password-based authentication schemes such as Kerberos.[Note: Classes that implement the ICredentials interface, such as the CredentialCache class, return NetworkCredential instances.
This class does not support public key-based authentication methods such as SSL client authentication.
]
System.Net Namespace
NetworkCredential Constructors
NetworkCredential() Constructor
NetworkCredential(System.String, System.String) Constructor
NetworkCredential(System.String, System.String, System.String) Constructor
NetworkCredential Methods
NetworkCredential.GetCredential Method
NetworkCredential Properties
NetworkCredential.Domain Property
NetworkCredential.Password Property
NetworkCredential.UserName Property
public NetworkCredential();
Constructs and initializes a new instance of the NetworkCredential class.
The properties of the new NetworkCredential instance are initialized tonull
.
System.Net.NetworkCredential Class, System.Net Namespace
public NetworkCredential(string userName, string password);
Constructs and initializes a new instance of the NetworkCredential class with the specified user name and password.
- userName
- A String containing the user name for the account associated with the credentials.
- password
- A String containing the password for the account associated with the credentials.
This constructor initializes the System.Net.NetworkCredential.UserName property of the new instance to userName and the System.Net.NetworkCredential.Password property to password. The System.Net.NetworkCredential.Domain property is initialized to System.String.Empty. The values specified for userName and password are passed through to the operating system without modification.
System.Net.NetworkCredential Class, System.Net Namespace
public NetworkCredential(string userName, string password, string domain);
Constructs and initializes a new instance of the NetworkCredential class with the specified user name, password, and domain.
- userName
- A String containing the user name associated with the credentials.
- password
- A String containing the password for the user name associated with the credentials.
- domain
- A String containing the domain associated with the credentials.
This constructor initializes the System.Net.NetworkCredential.UserName property of the new instance to userName, the System.Net.NetworkCredential.Password property to password, and the System.Net.NetworkCredential.Domain property to domain. The values specified for userName, password and domain are passed through to the operating system without modification.
System.Net.NetworkCredential Class, System.Net Namespace
public NetworkCredential GetCredential(Uri uri, string authType);
Returns the current instance.
- uri
- A Uri representing the resource for which the client is to be authenticated.
- authType
- A String containing the System.Net.IAuthenticationModule.AuthenticationType of the IAuthenticationModule that will receive the credentials returned by this method.
The current NetworkCredential instance.
System.Net.NetworkCredential Class, System.Net Namespace
public string Domain { get; set; }
Gets or sets the domain or machine name that verifies the current credentials.
A String containing the name of the domain that verifies the current credentials.
The System.Net.NetworkCredential.Domain property indicates the domain or realm to which the account belongs. [Note: Typically, this is the host machine name where the application executes or the user domain for the currently logged in user.]
System.Net.NetworkCredential Class, System.Net Namespace
public string Password { get; set; }
Gets or sets the password of the account associated with the current credentials.
A String containing the password of the account associated with the current credentials.
System.Net.NetworkCredential Class, System.Net Namespace
public string UserName { get; set; }
Gets or sets the user name for the account associated with the current credentials.
A String containing the user name for the account associated with the current credentials.
System.Net.NetworkCredential Class, System.Net Namespace