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

📄 global.asax

📁 asp.net技术内幕的书配源码
💻 ASAX
字号:
<%@ Language="C#" %>
<%@ Import Namespace="System.IO" %>


<script runat=server>

void Application_BeginRequest(Object sender , EventArgs e) 
{

   string strUsername;
   string  strCustomPath;

  if ( Request.Path.ToLower().IndexOf("custom" ) == -1 )
  {
    strUsername = Path.GetFileNameWithoutExtension(Request.Path);

    if ( Request.ApplicationPath == "/" )
    	strCustomPath = string .Format( "/custom/default.aspx?username={0}", strUsername );
    else
    	strCustomPath = string .Format( "{0}/custom/default.aspx?username={1}", Request.ApplicationPath, strUsername );

    Context.RewritePath( strCustomPath );
  }
}
</Script>

⌨️ 快捷键说明

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