Esempio n. 1
0
        private static bool smethod_1(HttpContext httpContext_0)
        {
            string path = httpContext_0.Request.Path;
            string text = UrlReWriteProvider.Instance().RewriteUrl(path, httpContext_0.Request.Url.Query);

            if (text != null)
            {
                string queryString = null;
                int    num         = text.IndexOf('?');
                if (num >= 0)
                {
                    queryString = ((num < text.Length - 1) ? text.Substring(num + 1) : string.Empty);
                    text        = text.Substring(0, num);
                }
                httpContext_0.RewritePath(text, null, queryString);
            }
            return(text != null);
        }
Esempio n. 2
0
        private static bool ReWriteUrl(HttpContext context)
        {
            string path     = context.Request.Path;
            string filePath = UrlReWriteProvider.Instance().RewriteUrl(path, context.Request.Url.Query);

            if (filePath != null)
            {
                string queryString = null;
                int    index       = filePath.IndexOf('?');
                if (index >= 0)
                {
                    queryString = (index < (filePath.Length - 1)) ? filePath.Substring(index + 1) : string.Empty;
                    filePath    = filePath.Substring(0, index);
                }
                context.RewritePath(filePath, null, queryString);
            }
            return(filePath != null);
        }