System.Net.CredentialHostKey.ToString C# (CSharp) Method

ToString() public method

public ToString ( ) : string
return string
        public override string ToString() {
            return "[" + Host.Length.ToString(NumberFormatInfo.InvariantInfo) + "]:" + Host + ":" + Port.ToString(NumberFormatInfo.InvariantInfo) + ":" + ValidationHelper.ToString(AuthenticationType);
        }

Usage Example

        public void Add(string host, int port, string authenticationType, NetworkCredential credential)
        {
            // Parameter validation
            if (host == null)
            {
                throw new ArgumentNullException("host");
            }

            if (authenticationType == null)
            {
                throw new ArgumentNullException("authenticationType");
            }

            if (host.Length == 0)
            {
                throw new ArgumentException(SR.Format(SR.net_emptystringcall, "host"));
            }

            if (port < 0)
            {
                throw new ArgumentOutOfRangeException("port");
            }

            ++_version;

            CredentialHostKey key = new CredentialHostKey(host, port, authenticationType);

            GlobalLog.Print("CredentialCache::Add() Adding key:[" + key.ToString() + "], cred:[" + credential.Domain + "],[" + credential.UserName + "]");

            _cacheForHosts.Add(key, credential);
            if (credential is SystemNetworkCredential)
            {
                ++_numbDefaultCredInCache;
            }
        }
All Usage Examples Of System.Net.CredentialHostKey::ToString