⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usermappath.cs

📁 东软内部材料(四)asp等相关的教学案例 
💻 CS
字号:
using System;
using System.Web;

public class UserMapPath : IHttpModule {
  public String ModuleName {
    get {
      return "UserMapPath";
    }
  }

  public void Init(HttpApplication app) {
    app.BeginRequest += new EventHandler(this.App_BeginRequest);
  }

  public void App_BeginRequest(Object sender, EventArgs e) {
    HttpApplication application = (HttpApplication) sender;
    HttpContext context = application.Context;
    HttpRequest Request = context.Request;

    String path = Request.Path;
    int index = path.IndexOf("~");
    
    if (index > 0) {
      String newPath = path.Substring(0, (index - 1));
      String name = path.Substring(index);
context.Response.Write(newPath + " : " + name);
      
    }
  }

  public void Dispose() {
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -