Пример #1
0
        // See
        public bool shExpMatch(string host, string pattern)
        {
            GlobalLog.Print("WebProxyScriptHelper::shExpMatch() host:" + ValidationHelper.ToString(host) + " pattern:" + ValidationHelper.ToString(pattern));
            if (host == null)
            {
                if (Logging.On)
                {
                    Logging.PrintWarning(Logging.Web, SR.GetString(SR.net_log_proxy_called_with_null_parameter, "WebProxyScriptHelper.shExpMatch()", "host"));
                }
                throw new ArgumentNullException("host");
            }
            if (pattern == null)
            {
                if (Logging.On)
                {
                    Logging.PrintWarning(Logging.Web, SR.GetString(SR.net_log_proxy_called_with_null_parameter, "WebProxyScriptHelper.shExpMatch()", "pattern"));
                }
                throw new ArgumentNullException("pattern");
            }

            try
            {
                // This can throw - treat as no match.
                ShellExpression exp = new ShellExpression(pattern);
                return(exp.IsMatch(host));
            }
            catch (FormatException)
            {
                return(false);
            }
        }
Пример #2
0
 public bool shExpMatch(string host, string pattern)
 {
     if (host == null)
     {
         if (Logging.On)
         {
             Logging.PrintWarning(Logging.Web, SR.GetString("net_log_proxy_called_with_null_parameter", new object[] { "WebProxyScriptHelper.shExpMatch()", "host" }));
         }
         throw new ArgumentNullException("host");
     }
     if (pattern == null)
     {
         if (Logging.On)
         {
             Logging.PrintWarning(Logging.Web, SR.GetString("net_log_proxy_called_with_null_parameter", new object[] { "WebProxyScriptHelper.shExpMatch()", "pattern" }));
         }
         throw new ArgumentNullException("pattern");
     }
     try
     {
         ShellExpression expression = new ShellExpression(pattern);
         return(expression.IsMatch(host));
     }
     catch (FormatException)
     {
         return(false);
     }
 }
Пример #3
0
        // See bug 87334 for details on the implementation.
        public bool shExpMatch(string host, string pattern) {
            GlobalLog.Print("WebProxyScriptHelper::shExpMatch() host:" + ValidationHelper.ToString(host) + " pattern:" + ValidationHelper.ToString(pattern));
            if (host==null) {
                if(Logging.On)Logging.PrintWarning(Logging.Web, SR.GetString(SR.net_log_proxy_called_with_null_parameter, "WebProxyScriptHelper.shExpMatch()", "host"));
                throw new ArgumentNullException("host");
            }
            if (pattern==null) {
                if(Logging.On)Logging.PrintWarning(Logging.Web, SR.GetString(SR.net_log_proxy_called_with_null_parameter, "WebProxyScriptHelper.shExpMatch()", "pattern"));
                throw new ArgumentNullException("pattern");
            }

            try
            {
                // This can throw - treat as no match.
                ShellExpression exp = new ShellExpression(pattern);
                return exp.IsMatch(host);
            }
            catch (FormatException)
            {
                return false;
            }
        }
 public bool shExpMatch(string host, string pattern)
 {
     if (host == null)
     {
         if (Logging.On)
         {
             Logging.PrintWarning(Logging.Web, SR.GetString("net_log_proxy_called_with_null_parameter", new object[] { "WebProxyScriptHelper.shExpMatch()", "host" }));
         }
         throw new ArgumentNullException("host");
     }
     if (pattern == null)
     {
         if (Logging.On)
         {
             Logging.PrintWarning(Logging.Web, SR.GetString("net_log_proxy_called_with_null_parameter", new object[] { "WebProxyScriptHelper.shExpMatch()", "pattern" }));
         }
         throw new ArgumentNullException("pattern");
     }
     try
     {
         ShellExpression expression = new ShellExpression(pattern);
         return expression.IsMatch(host);
     }
     catch (FormatException)
     {
         return false;
     }
 }