Определить логин в HttpModule - PullRequest
0 голосов
/ 05 января 2012

Я разрабатываю HttpModule и мне нужно определить процесс входа и выхода из системы. Как я могу это сделать?

Есть идеи?

Заранее спасибо

1 Ответ

0 голосов
/ 05 января 2012

Это ты о чем?

    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))
        { 
            // ...
        }
    }
...