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

Remove() public method

public Remove ( string host, int port, string authenticationType ) : void
host string
port int
authenticationType string
return void
        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);
        }

Same methods

CredentialCache::Remove ( Uri uriPrefix, string authType ) : 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