Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Add() [1/2]

void System.Net.CredentialCache.Add ( string host,
int port,
string authenticationType,
NetworkCredential credential )
inline

Definition at line 192 of file CredentialCache.cs.

193 {
194 if (host == null)
195 {
196 throw new ArgumentNullException("host");
197 }
198 if (authenticationType == null)
199 {
200 throw new ArgumentNullException("authenticationType");
201 }
202 if (host.Length == 0)
203 {
204 throw new ArgumentException(System.SR.Format(System.SR.net_emptystringcall, "host"), "host");
205 }
206 if (port < 0)
207 {
208 throw new ArgumentOutOfRangeException("port");
209 }
210 if (credential is SystemNetworkCredential && !string.Equals(authenticationType, "NTLM", StringComparison.OrdinalIgnoreCase) && !string.Equals(authenticationType, "Kerberos", StringComparison.OrdinalIgnoreCase) && !string.Equals(authenticationType, "Negotiate", StringComparison.OrdinalIgnoreCase))
211 {
213 }
214 _version++;
215 CredentialHostKey credentialHostKey = new CredentialHostKey(host, port, authenticationType);
216 if (NetEventSource.Log.IsEnabled())
217 {
218 NetEventSource.Info(this, $"Adding key:[{credentialHostKey}], cred:[{credential.Domain}],[{credential.UserName}]", "Add");
219 }
220 if (_cacheForHosts == null)
221 {
223 }
225 }
void Add(TKey key, TValue value)
Dictionary< CredentialHostKey, NetworkCredential > _cacheForHosts
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string net_nodefaultcreds
Definition SR.cs:44
static string net_emptystringcall
Definition SR.cs:14
Definition SR.cs:7

References System.Net.CredentialCache._cacheForHosts, System.Net.CredentialCache._version, System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Net.Equals, System.SR.Format(), System.Net.NetEventSource.Info(), System.Net.NetEventSource.Log, System.SR.net_emptystringcall, and System.SR.net_nodefaultcreds.