110,546
社区成员
发帖
与我相关
我的任务
分享
public class HttpModuleBLL : IHttpModule,IRequiresSessionState
{
public void Init(HttpApplication application)
{
application.BeginRequest += new EventHandler(application_BeginRequest);
}
private void application_BeginRequest(object sender, EventArgs e)
{
string domain = "www";
HttpApplication application = (HttpApplication)sender;
//if这里错了,HttpContext.Current.Session==null
if (HttpContext.Current.Session["domain"] == null || HttpContext.Current.Session["domain"].ToString() != "www")
{
HttpContext.Current.Session["domain"] = domain;
//其他代码
}
}
public void Dispose()
{
throw new NotImplementedException();
}
}