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

📄 usermappath.vb

📁 This is a book about vb.you could learn this from this book
💻 VB
字号:
Imports System
Imports System.Web

Public Class UserMapPath
		Implements IHttpModule

  Public ReadOnly Property ModuleName() As String
    Get
      Return "UserMapPath"
    End Get
  End Property

  Public Sub Init(app As HttpApplication) Implements IHttpModule.Init
    AddHandler app.BeginRequest, AddressOf App_BeginRequest
  End Sub

  Public Sub App_BeginRequest(sender As Object, e As EventArgs)
  
    Dim application As HttpApplication = CType(sender, HttpApplication)
    Dim context As HttpContext = application.Context
    Dim Request As HttpRequest = context.Request

    Dim path As String = Request.Path
    Dim index As Integer = path.IndexOf("~")
    
    If index > 0 Then
      Dim newPath As String = path.Substring(0, (index - 1))
      Dim name As String = path.Substring(index)
      context.Response.Write(newPath & " : " & name)
      
    End If
  
  End Sub

  Public Sub Dispose() Implements IHttpModule.Dispose
  End Sub

End Class

⌨️ 快捷键说明

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