日期:2014-05-18 浏览次数:20409 次
public void ProcessRequest(HttpContext context) { if (context == null) return; string url = context.Request.CurrentExecutionFilePath; if (url.StartsWith("/fckeditor", StringComparison.CurrentCultureIgnoreCase) == false) { List<RegexInfo> _regex_list = BLL.CacheHepler.RewriterCache.ReadRewriterRule(context); foreach (RegexInfo r in _regex_list) { //建立正则表达式 Regex Reg = new Regex(r.NewPath, RegexOptions.IgnoreCase); Match m = Reg.Match(RawUrl);//匹配 if (m.Success)//成功 { RawUrl = Reg.Replace(RawUrl, r.RealPath);//匹配出其真实的URL context.Server.Execute(RawUrl); context.Response.End(); return; } } IHttpHandler hander = BuildManager.CreateInstanceFromVirtualPath(RawUrl, typeof(Page)) as IHttpHandler; hander.ProcessRequest(context); } }