public class NetworkCredential : ICredentials
|
This class does not support public key-based authentication methods such as SSL client authentication.
NetworkCredential myCred = new NetworkCredential("username","password","domain");
CredentialCache myCache = new CredentialCache();
myCache.Add(new Uri("www.contoso.com"), "Basic", myCred);
myCache.Add(new Uri("app.contoso.com"), "Basic", myCred);
WebRequest wr = WebRequest.Create("www.contoso.com");
wr.Credentials = myCache;
| ctor #1 | Overloaded:.ctor()Default constructor. This constructor is called by derived class constructors to initialize state in this type.Initializes a new instance of the NetworkCredential class. |
| ctor #2 | Overloaded:.ctor(string userName, string password) Initializes a new instance of the NetworkCredential class with the specified user name and password. |
| ctor #3 | Overloaded:.ctor(string userName, string password, string domain) Initializes a new instance of the NetworkCredential class with the specified user name, password, and domain. |
| Domain | Read-write Gets or sets the domain or computer name that verifies the credentials. |
| Password | Read-write Gets or sets the password for the user name associated with the credentials. |
| UserName | Read-write Gets or sets the user name associated with the credentials. |
| Equals (inherited from System.Object) |
See base class member description: System.Object.Equals Derived from System.Object, the primary base class for all objects. |
| GetCredential | Returns an instance of the NetworkCredential class for the specified URI and authentication type. |
| GetHashCode (inherited from System.Object) |
See base class member description: System.Object.GetHashCode Derived from System.Object, the primary base class for all objects. |
| GetType (inherited from System.Object) |
See base class member description: System.Object.GetType Derived from System.Object, the primary base class for all objects. |
| ToString (inherited from System.Object) |
See base class member description: System.Object.ToString Derived from System.Object, the primary base class for all objects. |
| Finalize (inherited from System.Object) |
See base class member description: System.Object.Finalize Derived from System.Object, the primary base class for all objects. |
| MemberwiseClone (inherited from System.Object) |
See base class member description: System.Object.MemberwiseClone Derived from System.Object, the primary base class for all objects. |
Hierarchy:
public NetworkCredential(); |
userName
password
userName
password
domain
public string Domain {get; set;}
|
public string Password {get; set;}
|
public string UserName {get; set;}
|
~NetworkCredential(); |
public NetworkCredential GetCredential( |
uri
authType
public virtual int GetHashCode(); |
public Type GetType(); |
protected object MemberwiseClone(); |
public virtual string ToString(); |