using System;
using System.Web;
namespace MyLib {
class SimpleModule : IHttpModule {
public void Init(HttpApplication application) {
application.BeginRequest += new
EventHandler(this.Application_BeginRequest);
}
public void Dispose() {
}
public void Application_BeginRequest(object source, EventArgs e) {
HttpApplication application = (HttpApplication)source;
application.Context.Response.Write("a module can end the request");
application.Context.Response.End();
}
}
}
BuildSimpleModule.bat
csc /target:library /reference:System.Web.dll
/out:MyLib.dll SimpleModule.cs
ModuleWeb.config
type="MyLib.SimpleModule,
MyLib" />