How to get VirtualDir name from Application_onStart ?

F

F C

Hello,

I would like to find the virtual directory name from within
Application_onStart in global.asa.
I am in ASP, not ASPX. I have no server.AppPath.

Thanks for your help.

François.
 
A

Adrienne Boswell

Hello,

I would like to find the virtual directory name from within
Application_onStart in global.asa.
I am in ASP, not ASPX. I have no server.AppPath.

Thanks for your help.
<% For Each strKey In Request.ServerVariables %>
<%= strKey %> = <%= Request.ServerVariables(strKey) %><br />
<% next %>

will give you all the server variables, and the one you want, IIRC, is
APPL_PHYSICAL_PATH
 
F

F C

Adrienne Boswell said:
Gazing into my crystal ball I observed "F C"
writing in
<% For Each strKey In Request.ServerVariables %>
<%= strKey %> = <%= Request.ServerVariables(strKey) %><br />
<% next %>

will give you all the server variables, and the one you want, IIRC, is
APPL_PHYSICAL_PATH

The Request object is not available in Application_onStart. And I must
process the virtual dir name in Application_onStart before any client has a
chance to connect to my server.

Thanks.
 
M

Mark Schupp

You have 2 choices that I can see.

1. hardcode the virtual directory name in global.asa or in a settings file
that global.asa can read.
2. get the virtual directory name in the session_onstart subroutine on the
first request from the first client.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top