Export (0) Print
Expand All

NetworkCredential Class

Provides credentials for password-based authentication schemes such as basic, digest, NTLM, and Kerberos authentication.

System.Object
  System.Net.NetworkCredential

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

type NetworkCredential =  
    class
        interface ICredentials
        interface ICredentialsByHost
    end

The NetworkCredential type exposes the following members.

  NameDescription
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryNetworkCredential()Initializes a new instance of the NetworkCredential class.
Public methodNetworkCredential(String, SecureString)Initializes a new instance of the NetworkCredential class with the specified user name and password.
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryNetworkCredential(String, String)Initializes a new instance of the NetworkCredential class with the specified user name and password.
Public methodNetworkCredential(String, SecureString, String)Initializes a new instance of the NetworkCredential class with the specified user name, password, and domain.
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryNetworkCredential(String, String, String)Initializes a new instance of the NetworkCredential class with the specified user name, password, and domain.
Top

  NameDescription
Public propertySupported by the XNA FrameworkSupported by Portable Class LibraryDomainGets or sets the domain or computer name that verifies the credentials.
Public propertySupported by the XNA FrameworkSupported by Portable Class LibraryPasswordGets or sets the password for the user name associated with the credentials.
Public propertySecurePasswordGets or sets the password as a SecureString instance.
Public propertySupported by the XNA FrameworkSupported by Portable Class LibraryUserNameGets or sets the user name associated with the credentials.
Top

  NameDescription
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodSupported by the XNA FrameworkSupported by Portable Class LibraryFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryGetCredential(Uri, String)Returns an instance of the NetworkCredential class for the specified Uniform Resource Identifier (URI) and authentication type.
Public methodGetCredential(String, Int32, String)Returns an instance of the NetworkCredential class for the specified host, port, and authentication type.
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by the XNA FrameworkSupported by Portable Class LibraryMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryToStringReturns a string that represents the current object. (Inherited from Object.)
Top

The NetworkCredential class is a base class that supplies credentials in password-based authentication schemes such as basic, digest, NTLM, and Kerberos. Classes that implement the ICredentials interface, such as the CredentialCache class, return NetworkCredential objects.

This class does not support public key-based authentication methods such as Secure Sockets Layer (SSL) client authentication.

The following code example associates a NetworkCredential object with a set of Uniform Resource Identifiers (URIs) in a CredentialCache. It then passes the CredentialCache to a WebRequest object, which uses it to authenticate requests to an Internet server.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft