我正在开发一个HttpModule,我需要检测登录和注销过程。我怎么能这样做?
有什么想法吗?
提前致谢
答案 0 :(得分:0)
你的意思吗?
public void Init(HttpApplication context)
{
context.PreRequestHandlerExecute += new EventHandler(context_PreRequestHandlerExecute);
}
void context_PreRequestHandlerExecute(object sender, EventArgs e)
{
HttpApplication app = (HttpApplication)sender;
HttpContext context = app.Context;
HttpResponse response = context.Response;
if (IsLoginPage(context))
{
// ...
}
else if (IsLogoutPage(context))
{
// ...
}
}