Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Retrieve IIS Applicaton Path

Reply
Thread Tools

Retrieve IIS Applicaton Path

 
 
Raterus
Guest
Posts: n/a
 
      01-12-2007
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

 
Reply With Quote
 
 
 
 
Raterus
Guest
Posts: n/a
 
      01-12-2007
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" <(E-Mail Removed)> wrote in message news:%(E-Mail Removed)...
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using aspnet Impersonation, ASPNET_SETREG, applicaton throws buffer overflow. jay@gloryfish.org ASP .Net 2 10-21-2005 04:39 PM
OLE version of microsoft applicaton block data access?? guoqi zheng ASP .Net 2 04-16-2005 07:12 AM
Debugging local ASP.Net applicaton on WinXP.SP2 =?Utf-8?B?QWxleCBLdWRha292?= ASP .Net 1 01-26-2005 09:33 PM
ASP.Net applicaton deployment problem. nick ASP .Net 3 07-06-2004 07:55 AM
Applicaton on Handhelp using ASP.NET Ashish Gupta ASP .Net 1 07-01-2003 06:52 PM



Advertisments