码迷,mamicode.com
首页 > Web开发 > 详细

CheckSessionHttpModult

时间:2015-01-11 12:14:26      阅读:123      评论:0      收藏:0      [点我收藏+]

标签:

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");
}
}
}
}
}

CheckSessionHttpModult

标签:

原文地址:http://www.cnblogs.com/bidianqing/p/4216224.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!