public void Remove(string host, int port, string authenticationType) { if (host==null || authenticationType==null) { // these couldn't possibly have been inserted into // the cache because of the test in Add() return; } if (port < 0) { return; } ++m_version; CredentialHostKey key = new CredentialHostKey(host, port, authenticationType); GlobalLog.Print("CredentialCache::Remove() Removing key:[" + key.ToString() + "]"); if (cacheForHosts[key] is SystemNetworkCredential) { --m_NumbDefaultCredInCache; } cacheForHosts.Remove(key); }
public static void Init(string apiKey, string apiUrl) { _apiUrl = apiUrl; if (!_apiUrl.EndsWith("/")) { _apiUrl += "/"; } _cc = new CredentialCache(); var url = new Uri(_apiUrl); _cc.Remove(url, "Basic"); _cc.Add(url, "Basic", new NetworkCredential("api_key", apiKey)); }