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

◆ GetCredential() [2/2]

NetworkCredential? System.Net.CredentialCache.GetCredential ( Uri uriPrefix,
string authType )
inline

Implements System.Net.ICredentials.

Definition at line 273 of file CredentialCache.cs.

274 {
275 if (uriPrefix == null)
276 {
277 throw new ArgumentNullException("uriPrefix");
278 }
279 if (authType == null)
280 {
281 throw new ArgumentNullException("authType");
282 }
283 if (_cache == null)
284 {
285 if (NetEventSource.Log.IsEnabled())
286 {
287 NetEventSource.Info(this, "CredentialCache::GetCredential short-circuiting because the dictionary is null.", "GetCredential");
288 }
289 return null;
290 }
291 int num = -1;
292 NetworkCredential networkCredential = null;
294 {
295 CredentialKey key = item.Key;
296 if (key.Match(uriPrefix, authType))
297 {
298 int uriPrefixLength = key.UriPrefixLength;
299 if (uriPrefixLength > num)
300 {
301 num = uriPrefixLength;
302 networkCredential = item.Value;
303 }
304 }
305 }
306 if (NetEventSource.Log.IsEnabled())
307 {
308 NetEventSource.Info(this, FormattableStringFactory.Create("Returning {0}", (networkCredential == null) ? "null" : ("(" + networkCredential.UserName + ":" + networkCredential.Domain + ")")), "GetCredential");
309 }
310 return networkCredential;
311 }
Dictionary< CredentialKey, NetworkCredential > _cache
static FormattableString Create(string format, params object?[] arguments)

References System.Net.CredentialCache._cache, System.Runtime.CompilerServices.FormattableStringFactory.Create(), System.Net.NetEventSource.Info(), System.item, System.key, and System.Net.NetEventSource.Log.