Asp classic 经典ASP中Path_INFO服务器变量的可靠性
我是否总是能够像下面的函数一样使用PATH_INFO来派生我的应用程序的根Asp classic 经典ASP中Path_INFO服务器变量的可靠性,asp-classic,path,Asp Classic,Path,我是否总是能够像下面的函数一样使用PATH_INFO来派生我的应用程序的根 function CommonFunctions_getRoot() pathinfo=Request.ServerVariables("PATH_INFO") Set myRegExp = New RegExp myRegExp.IgnoreCase = True myRegExp.Global = True myRegExp.Pattern = "^(/\w*/).*"
function CommonFunctions_getRoot()
pathinfo=Request.ServerVariables("PATH_INFO")
Set myRegExp = New RegExp
myRegExp.IgnoreCase = True
myRegExp.Global = True
myRegExp.Pattern = "^(/\w*/).*"
CommonFunctions_getRoot = myRegExp.Replace (pathinfo, "$1")
end function
路径信息是可靠的。我能想到的唯一问题是,如果使用URL重写,您可能会遇到问题。谢谢!我不这样做;这是一个普通的ASP应用程序。