System.Net.WebProxyScriptHelper.WebProxyScriptHelper.dnsDomainIs C# (CSharp) Method

dnsDomainIs() public method

public dnsDomainIs ( string host, string domain ) : bool
host string
domain string
return bool
        public bool dnsDomainIs(string host, string domain) {
            GlobalLog.Print("WebProxyScriptHelper::dnsDomainIs() host:" + ValidationHelper.ToString(host) + " domain:" + ValidationHelper.ToString(domain));
            if (host==null) {
                if(Logging.On)Logging.PrintWarning(Logging.Web, SR.GetString(SR.net_log_proxy_called_with_null_parameter, "WebProxyScriptHelper.dnsDomainIs()", "host"));
                throw new ArgumentNullException("host");
            }
            if (domain==null) {
                if(Logging.On)Logging.PrintWarning(Logging.Web, SR.GetString(SR.net_log_proxy_called_with_null_parameter, "WebProxyScriptHelper.dnsDomainIs()", "domain"));
                throw new ArgumentNullException("domain");
            }
            int index = host.LastIndexOf(domain);
            return index != -1 && (index+domain.Length) == host.Length;
        }