| Author |
How to get the web site physical path
|
|
| Jaime Stuardo 2005-11-26, 6:55 pm |
| Hi all...
How can I get the physical path of a web site from an EXE application? The
Web Site is on the same server as the application.
Thanks in advance
Jaime
| |
| McKirahan 2005-11-26, 6:55 pm |
| "Jaime Stuardo" <jstuardo@manquehue.net> wrote in message
news:#0dTIsq8FHA.1484@tk2msftngp13.phx.gbl...
> Hi all...
>
> How can I get the physical path of a web site from an EXE application? The
> Web Site is on the same server as the application.
>
> Thanks in advance
> Jaime
Request.ServerVariables("APPL_PHYSICAL_PATH")
or
Request.ServerVariables("PATH_TRANSLATED")
may give you what you want.
| |
| Jaime Stuardo 2005-11-26, 6:55 pm |
| But I cannot access server variables when I am in an EXE application since
it is ran in a different context. Or do you know a way how to get a
reference to the Request object from an EXE application?
Thanks
Jaime
"McKirahan" <News@McKirahan.com> wrote in message
news:1JKdnea1fvxhIxXeRVn-tA@comcast.com...
> "Jaime Stuardo" <jstuardo@manquehue.net> wrote in message
> news:#0dTIsq8FHA.1484@tk2msftngp13.phx.gbl...
>
> Request.ServerVariables("APPL_PHYSICAL_PATH")
> or
> Request.ServerVariables("PATH_TRANSLATED")
> may give you what you want.
>
>
| |
| McKirahan 2005-11-26, 6:55 pm |
| "Jaime Stuardo" <jstuardo@manquehue.net> wrote in message
news:eduXpXs8FHA.1416@TK2MSFTNGP09.phx.gbl...
> But I cannot access server variables when I am in an EXE application since
> it is ran in a different context. Or do you know a way how to get a
> reference to the Request object from an EXE application?
[snip]
Could you be more specific about what you're trying to do and why?
| |
| Jaime Stuardo 2005-11-26, 9:55 pm |
| I thought it was clear, sorry..
I have a VB application compiled as an EXE file that is scheduled to ran at
certain time. That EXE file accesses some configuration information from a
web site. That configuration information is, for example, some connection
strings.
That information is present in a file under the web site directory. That's
why I need to get the physical path of it. I want to do that so that I don't
need to hard code the path.
3 things to have in mind :
- The system is already designed. I'm just correcting some errors produced
when my customer moved some directories from one partition to another.
- I cannot use an INI file
- I can hard-code the path, but if for some reason, the customer move the
files again from one partition to another, or from one directory to another,
the system will fail again.
Thanks
Jaime
"McKirahan" <News@McKirahan.com> wrote in message
news:TtadnVVvRbdNURXeRVn-hQ@comcast.com...
> "Jaime Stuardo" <jstuardo@manquehue.net> wrote in message
> news:eduXpXs8FHA.1416@TK2MSFTNGP09.phx.gbl...
>
> [snip]
>
> Could you be more specific about what you're trying to do and why?
>
>
| |
| PJones 2005-11-27, 3:55 am |
|
http://www.powerasp.com/content/hin...ysical-path.asp
"Jaime Stuardo" <jstuardo@manquehue.net> wrote in message
news:%230dTIsq8FHA.1484@tk2msftngp13.phx.gbl...
> Hi all...
>
> How can I get the physical path of a web site from an EXE application? The
> Web Site is on the same server as the application.
>
> Thanks in advance
> Jaime
>
| |
| McKirahan 2005-11-27, 3:55 am |
| "Jaime Stuardo" <jstuardo@manquehue.net> wrote in message
news:#AxTuYv8FHA.952@TK2MSFTNGP12.phx.gbl...
> I thought it was clear, sorry..
>
> I have a VB application compiled as an EXE file that is scheduled to ran
at
> certain time. That EXE file accesses some configuration information from a
> web site. That configuration information is, for example, some connection
> strings.
>
> That information is present in a file under the web site directory. That's
> why I need to get the physical path of it. I want to do that so that I
don't
> need to hard code the path.
>
> 3 things to have in mind :
>
> - The system is already designed. I'm just correcting some errors produced
> when my customer moved some directories from one partition to another.
> - I cannot use an INI file
> - I can hard-code the path, but if for some reason, the customer move the
> files again from one partition to another, or from one directory to
another,
> the system will fail again.
>
[snip]
Have you tried "App.Path" in your VB application?
(Note -- this is a VB question not an ASP question.)
| |
| Bob Barrows [MVP] 2005-11-27, 7:55 am |
| Your web site will need to have an ASP page that returns the physical path
(via the servervariables, or by using server.mappath).
You VB ap will need to use the XMLHTTPRequest object (it's part of the msxml
parser) to request the page and receive its response.
You can get more details in a VB group.
Bob Barrows
Jaime Stuardo wrote:[color=darkred]
> I thought it was clear, sorry..
>
> I have a VB application compiled as an EXE file that is scheduled to
> ran at certain time. That EXE file accesses some configuration
> information from a web site. That configuration information is, for
> example, some connection strings.
>
> That information is present in a file under the web site directory.
> That's why I need to get the physical path of it. I want to do that
> so that I don't need to hard code the path.
>
> 3 things to have in mind :
>
> - The system is already designed. I'm just correcting some errors
> produced when my customer moved some directories from one partition
> to another. - I cannot use an INI file
> - I can hard-code the path, but if for some reason, the customer move
> the files again from one partition to another, or from one directory
> to another, the system will fail again.
>
> Thanks
> Jaime
>
> "McKirahan" <News@McKirahan.com> wrote in message
> news:TtadnVVvRbdNURXeRVn-hQ@comcast.com...
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
| |
| Jaime Stuardo 2005-11-27, 6:55 pm |
| Thanks Bob... Your solution worked.
Jaime
"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:eb469n18FHA.3880@TK2MSFTNGP12.phx.gbl...
> Your web site will need to have an ASP page that returns the physical path
> (via the servervariables, or by using server.mappath).
> You VB ap will need to use the XMLHTTPRequest object (it's part of the
> msxml parser) to request the page and receive its response.
>
> You can get more details in a VB group.
>
> Bob Barrows
>
>
> Jaime Stuardo wrote:
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
|
|
|
|