首页 > Web开发 > 详细

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

时间:2015-07-11 06:38:38      阅读:216      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!