472,145 Members | 1,444 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,145 software developers and data experts.

Retrieve IIS Applicaton Path

I need to routine that will return what 'Request.ApplicationPath' would return in asp.net.

If you are not familiar with that, I just need to know the IIS virtual directory the application is running in, relative to the server root.

I've looked through all the server variables, but don't see anything that will help me, without having to do some string parsing (and even then I'd be guessing at the virtual directory).

A return value would look something like this...where "myapp" is the virtual directory
"/webapps/myapp/"

Any help is much appreciated!
--Michael

Jan 12 '07 #1
1 1461
I found an answer,

Function ApplicationPath()
sApplicationPath = LCase(Request.ServerVariables("APPL_MD_PATH"))
ApplicationPath = Split(sApplicationPath, "root")(1)
End Function

Call Response.Write(ApplicationPath() & "<br><br>")

"Raterus" <ra*****@hotmail.comwrote in message news:%2****************@TK2MSFTNGP03.phx.gbl...
I need to routine that will return what 'Request.ApplicationPath' would return in asp.net.

If you are not familiar with that, I just need to know the IIS virtual directory the application is running in, relative to the server root.

I've looked through all the server variables, but don't see anything that will help me, without having to do some string parsing (and even then I'd be guessing at the virtual directory).

A return value would look something like this...where "myapp" is the virtual directory
"/webapps/myapp/"

Any help is much appreciated!
--Michael

Jan 12 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jan | last post: by
4 posts views Thread by Thanh-Nhan Le | last post: by
10 posts views Thread by kimiraikkonen | last post: by
reply views Thread by Saiars | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.