System.Net.CredentialCache.Remove C# (CSharp) Method

Remove() public method

public Remove ( Uri uriPrefix, string authType ) : void
uriPrefix Uri
authType string
return void
        public void Remove(Uri uriPrefix, string authType) {
            if (uriPrefix==null || authType==null) {
                // these couldn't possibly have been inserted into
                // the cache because of the test in Add()
                return;
            }

            ++m_version;

            CredentialKey key = new CredentialKey(uriPrefix, authType);

            GlobalLog.Print("CredentialCache::Remove() Removing key:[" + key.ToString() + "]");

            if (cache[key] is SystemNetworkCredential) {
                --m_NumbDefaultCredInCache;
            }
            cache.Remove(key);
        }

Same methods

CredentialCache::Remove ( string host, int port, string authenticationType ) : void

Usage Example

Example #1
0
 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));
 }
All Usage Examples Of System.Net.CredentialCache::Remove