文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>C#伪地址的应用

C#伪地址的应用

时间:2011-06-08  来源:binfire

建立httpModule

 

    <httpModules>
      <add type="WebSite.MyModule1" name="MyModule1"/>
    </httpModules>

  </system.web>

 

 

  

public void Init(HttpApplication context)
        {
            // 下面是如何处理 LogRequest 事件并为其
            // 提供自定义日志记录实现的示例
            //context.LogRequest += new EventHandler(OnLogRequest);
            context.BeginRequest += new EventHandler(context_BeginRequest);
        }

        void context_BeginRequest(object sender, EventArgs e)
        {
            HttpContext context = ((HttpApplication)sender).Context;
            string requestpath = context.Request.Path.ToLower();
            if (requestpath.IndexOf("news")>0)
            {
                context.RewritePath("../WebForm1.aspx");
            }
        }

相关阅读 更多 +
排行榜 更多 +
方块枪战战场安卓版

方块枪战战场安卓版

飞行射击 下载
战斗火力射击安卓版

战斗火力射击安卓版

飞行射击 下载
空中防御战安卓版

空中防御战安卓版

飞行射击 下载