标签:
namespace CZBK.TestProject.Common
{
public class CheckSessionHttpModult:IHttpModule
{
public void Dispose()
{
throw new NotImplementedException();
}
public void Init(HttpApplication context)
{
context.AcquireRequestState+=context_AcquireRequestState;
}
public void context_AcquireRequestState(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context=application.Context;
string filePath=context.Request.Url.ToString();
if (filePath.Contains("Admin"))
{
if (context.Session["userInfo"] == null)
{
context.Response.Redirect("/Login.aspx");
}
}
}
}
}
标签:
原文地址:http://www.cnblogs.com/bidianqing/p/4216224.html