【http】生命周期和http管道技术 整理中

httpModules 与 httpHandlers  正在写demo

public class Httpext : IHttpModule
{
public void Dispose()
{
throw new NotImplementedException();
}

public void Init(HttpApplication context)
{
context.BeginRequest += new EventHandler(this.BeginRequest);
}
private void BeginRequest(object r_objSender, EventArgs r_objEventArgs)
{
HttpApplication objApp = (HttpApplication)r_objSender;
objApp.Response.Write("您请求的URL为" + objApp.Request.Path);
}
}

<system.webServer>
<modules>
<add name="MyModule" type="httppip.Httpext, httppip, Version=1.0.0.0, Culture=neutral" />
</modules>

</system.webServer>

public partial class About : Page
{
protected void Page_Load(object sender, EventArgs e)
{

}

public override void ProcessRequest(HttpContext context)
{
context.Response.Write("我是HttpHandler");
}

}

上一篇:canvas小球动画


下一篇:golang github.com/go-sql-driver/mysql 遇到的数据库,设置库设计不合理的解决方法