日期:2014-05-17 浏览次数:20434 次
public class MyHttpModule:IHttpModule { #region IHttpModule 成员 public void Dispose() { } public void Init(HttpApplication context) { context.BeginRequest += Application_BeginRequest; } private void Application_BeginRequest(object sender, EventArgs e) { HttpApplication application = (HttpApplication)sender; HttpContext context = application.Context; string url = context.Request.RawUrl; if (!context.Request.RawUrl.Contains(".aspx")) { //你想要的操作 } context.RewritePath(url); } #endregion }