标签:sharepoint httpmodul sharepointhttpmodule sharepoint httpmodu sharepoint httpmo
首先写个IHttpModule的实现类
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Web; namespace NuctechEquipment.Layouts.NuctechEquipment.AppCore.HttpModules { public class ReqestModule : IHttpModule { //初始化---必须实现的 public void Init(HttpApplication context) { //事件注册----------吧自定义的方法注册 context.BeginRequest += new EventHandler(Application_BeginRequeset); context.EndRequest += new EventHandler(Application_EndRequeset); } //开始请求---自定义的重写的开始请求的方法和结束请求时候的方法 public void Application_BeginRequeset(object sender, EventArgs arg) { } //结束请求 public void Application_EndRequeset(object sender, EventArgs arg) { HttpApplication app = sender as HttpApplication; Console.WriteLine(app.Request.FilePath); if (app.Request.FilePath.Contains(".aspx") == false) { } } //释放---必须实现的 public void Dispose() { } } }
然后在iis 80 目录下面的webconfig的<modules runAllManagedModulesForAllRequests="true">节点下配置
<add name="ReqestModule" type="NuctechEquipment.Layouts.NuctechEquipment.AppCore.HttpModules.ReqestModule,NuctechEquipment" />
--name是名字 建议和类名一样
--type 逗号前面的是命名空间+类 逗号后面的类所在的dll 名字
最后把这个dll也放在iis 80网站下的bin目录里面就好了
标签:sharepoint httpmodul sharepointhttpmodule sharepoint httpmodu sharepoint httpmo
原文地址:http://blog.csdn.net/qq873113580/article/details/46604207