CredentialCache.Add Method (String, Int32, String, NetworkCredential)
Assembly: System (in system.dll)
public void Add ( string host, int port, string authenticationType, NetworkCredential credential )
public void Add ( String host, int port, String authenticationType, NetworkCredential credential )
public function Add ( host : String, port : int, authenticationType : String, credential : NetworkCredential )
A String that identifies the host computer.
A Int32 that specifies the port to connect to on host.
A String that identifies the authentication scheme used when connecting to host using cred. See Remarks.
The NetworkCredential to add to the credential cache.
This method places a NetworkCredential instance for use with SMTP into the CredentialCache. The cache stores credentials in the order in which they are added to it. When the GetCredential(String,Int32,String) method is called, it returns a NetworkCredential instance that is selected by matching the host, port, and authType. The comparison is done case-insensitively.
The supported values for authType are "NTLM", "Digest", "Kerberos", and "Negotiate".
Credentials added with this method are only valid for use with SMTP. This method does not work for HTTP or FTP protocols.
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter EditionThe Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.