62,040
社区成员
发帖
与我相关
我的任务
分享
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
}