Adds a 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.
- uriPrefix
- A 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 uriPrefix.
- cred
- The System.Net.NetworkCredential to add to the credential cache.
Type Reason ArgumentNullException The uriPrefix or authType parameter is null. ArgumentException The cache already contains a credential for the specified uriPrefix and authType.
The CredentialCache.Add(Uri, string, NetworkCredential) method places a System.Net.NetworkCredential instance for use with protocols other than SMTP into the System.Net.CredentialCache. The cache stores credentials in the order in which they are added to it. When the CredentialCache.GetCredential(Uri, string) method is called, it returns the proper matching System.Net.NetworkCredential instance.