-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAuthorizeModule.cs
More file actions
41 lines (33 loc) · 1.12 KB
/
AuthorizeModule.cs
File metadata and controls
41 lines (33 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Web;
namespace FilterWithHttpModule
{
public class AuthorizeModule : IHttpModule
{
/// <summary>
/// 您将需要在网站的 Web.config 文件中配置此模块
/// 并向 IIS 注册它,然后才能使用它。有关详细信息,
/// 请参见下面的链接: http://go.microsoft.com/?linkid=8101007
/// </summary>
#region IHttpModule Members
public void Dispose()
{
//此处放置清除代码。
}
public void Init(HttpApplication context)
{
// 下面是如何处理 LogRequest 事件并为其
// 提供自定义日志记录实现的示例
context.LogRequest += new EventHandler(OnLogRequest);
context.AcquireRequestState += new EventHandler(context_AcquireRequestState);
}
#endregion
public void OnLogRequest(Object source, EventArgs e)
{
//可以在此处放置自定义日志记录逻辑
}
public void context_AcquireRequestState(object sender, EventArgs e)
{
}
}
}