Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Net.​CredentialCache

Assembly: System.Net.Primitives

Inheritance: object → CredentialCache

Provides storage for multiple credentials.

Methods

public void
Add​(string host, int port, string authenticationType, NetworkCredential credential)
host A <see cref="T:System.String" /> that identifies the host computer.
port A <see cref="T:System.Int32" /> that specifies the port to connect to on <paramref name="host" /> .
authenticationType A <see cref="T:System.String" /> that identifies the authentication scheme used when connecting to <paramref name="host" /> using <paramref name="credential" /> .
credential The <see cref="T:System.Net.NetworkCredential" /> to add to the credential cache.
Adds a <see cref="T:System.Net.NetworkCredential" /> instance for use with SMTP to the credential cache and associates it with a host computer, port, and authentication protocol. Credentials added using this method are valid for SMTP only. This method does not work for HTTP or FTP requests.
public void
Add​(Uri uriPrefix, string authType, NetworkCredential cred)
uriPrefix A <see cref="T:System.Uri" /> that specifies the URI prefix of the resources that the credential grants access to.
authType The authentication scheme used by the resource named in <paramref name="uriPrefix" /> .
cred The <see cref="T:System.Net.NetworkCredential" /> to add to the credential cache.
Adds a <see cref="T:System.Net.NetworkCredential" /> instance to the credential cache for use with protocols other than SMTP and associates it with a Uniform Resource Identifier (URI) prefix and authentication protocol.
GetCredential​(string host, int port, string authenticationType)
host A <see cref="T:System.String" /> that identifies the host computer.
port A <see cref="T:System.Int32" /> that specifies the port to connect to on <paramref name="host" /> .
authenticationType A <see cref="T:System.String" /> that identifies the authentication scheme used when connecting to <paramref name="host" /> .
Returns A <see cref="T:System.Net.NetworkCredential" /> or, if there is no matching credential in the cache, <see langword="null" /> .
Returns the <see cref="T:System.Net.NetworkCredential" /> instance associated with the specified host, port, and authentication protocol.
GetCredential​(Uri uriPrefix, string authType)
uriPrefix A <see cref="T:System.Uri" /> that specifies the URI prefix of the resources that the credential grants access to.
authType The authentication scheme used by the resource named in <paramref name="uriPrefix" /> .
Returns A <see cref="T:System.Net.NetworkCredential" /> or, if there is no matching credential in the cache, <see langword="null" /> .
Returns the <see cref="T:System.Net.NetworkCredential" /> instance associated with the specified Uniform Resource Identifier (URI) and authentication type.
GetEnumerator​()
Returns An <see cref="T:System.Collections.IEnumerator" /> for the <see cref="T:System.Net.CredentialCache" /> .
Returns an enumerator that can iterate through the <see cref="T:System.Net.CredentialCache" /> instance.
public void
Remove​(string host, int port, string authenticationType)
host A <see cref="T:System.String" /> that identifies the host computer.
port A <see cref="T:System.Int32" /> that specifies the port to connect to on <paramref name="host" /> .
authenticationType A <see cref="T:System.String" /> that identifies the authentication scheme used when connecting to <paramref name="host" /> .
Deletes a <see cref="T:System.Net.NetworkCredential" /> instance from the cache if it is associated with the specified host, port, and authentication protocol.
public void
Remove​(Uri uriPrefix, string authType)
uriPrefix A <see cref="T:System.Uri" /> that specifies the URI prefix of the resources that the credential is used for.
authType The authentication scheme used by the host named in <paramref name="uriPrefix" /> .
Deletes a <see cref="T:System.Net.NetworkCredential" /> instance from the cache if it is associated with the specified Uniform Resource Identifier (URI) prefix and authentication protocol.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object