Cav*_*rob 7 directory path asp-classic
我的ASP Classic应用程序中有几个相对路径.为了设置路径,我想获得对我的特定应用程序的根目录的引用(因为服务器的根目录是不同的).
有没有办法做到这一点?
使用Request.ServerVariables("APPL_MD_PATH")或Request.ServerVariables("APPL_PHYSICAL_PATH")。
Cav*_*rob -1
我找到了一种使用一些服务器变量来做到这一点的方法。任何人都可以通过这种方式保证任何可能的错误吗?
function getRoot()
pathinfo=Request.ServerVariables("PATH_INFO")
Set myRegExp = New RegExp
myRegExp.IgnoreCase = True
myRegExp.Global = True
myRegExp.Pattern = "^(/\w*/).*"
' Pop up a message box for each match
getRoot = myRegExp.Replace (pathinfo, "$1")
end function
Run Code Online (Sandbox Code Playgroud)