【http】生命周期和http管道技术 整理中
2015-07-11 01:43
567 查看
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");
}
}
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协议研究
- [通信制式]手机网络制式常识
- [Android--USB]USB协议各个版本的关系_网络整理
- msl、ttl及rtt的区别—— TCP控制字段标志
- Android 如何使用网络图片资源
- iOS多线程与网络开发之多线程GCD
- 「深入 Exchange 2013」MAPI over HTTP实战配置
- muduo网络编程分包和解包(二)
- The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- 01 NIO网络通信框架 Netty server和client的api
- 人工神经网络之感知器算法
- atitit.http get post的原理以及框架实现java php
- atitit.http get post的原理以及框架实现java php
- 安装和配置网络存储服务器tgtadm
- Mitmproxy首页、文档和下载 - 支持SSL的HTTP代理 - 开源中国社区
- iOS网络协议----HTTP/TCP/IP浅析
- 详解网络传输中的三张表,MAC地址表、ARP缓存表以及路由表
- linux下出现ping:unknown host www.baidu.com问题时的解决办法——ubuntu下局域网络的配置
- TCP/IP协议簇概述
- android http status code