首先写一个处理urls重写的类,并且这个类必须继承ihttphandler接口,以博客园的程序为例:
【程序编程相关:四种XML解析技术之不完全测试】public class urlrewritemodule : system.web.ihttpmodule 【推荐阅读:从 .NET 开发人员的角度理解 Exc】
【扩展信息:下午之前对Blog的认识】{ public void init(httpapplication context) { context.beginrequest +=new eventhandler(context_beginrequest); }public void dispose()
{ } }urlrewritemodule类就是处理urls重写的类,继承ihttphandler接口,实现该接口的两个方法,init与dispose.在init方法里注册自己定义的方法,如上例所示:
content.beginrequest +=new eventhandler(content_beginrequest);
beginrequest是一个事件,在收到新的http请求时触发,content_beginrequest就是触发时处理的方法.... 下一页