开发者

Get root directory in ASP Classic application

I have several relative paths in my ASP Classic application. I'd like to get a reference to the root directory of my particular application (since the root of the server is som开发者_高级运维ething different) for the purpose of setting paths.

Is there a way to do this?


Have you tried

<%= Server.MapPath("/") %>


Use Request.ServerVariables("APPL_MD_PATH") or Request.ServerVariables("APPL_PHYSICAL_PATH").


I found a way to do it using some server variables. Can anyone vouch for any possible bugs this way?

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜