码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2015-07-11 06:40:10      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:

 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");
}


}

 

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

标签:

原文地址:http://www.cnblogs.com/viewcozy/p/4637832.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!