|
 |
aspx_professional thread: app path
Message #1 by "DT-Rene Vazquez" <renevazquez@c...> on Mon, 25 Nov 2002 10:28:07 -0500
|
|
Hi, what I really want is to map the path of a file in my app root
folder from a component.
Ok, my component is in the bin dir of the web app. I want to access a
file in the app root from my cs component. I initially do it with the
hole path "c:\.....", but I want to do it with the path relative to my
cs comp, I used this path: "../something.xml" thinking that because my
cs is in the bin dir it would go back one dir and get whatever file is
in the root, but instead it goes to this path: C:\WINNT\RMAFields.xml;
You know some way to refer to the root file relative to my component
Thanks a lot!
-----Original Message-----
From: Philip Steel [mailto:PhilipS@t...]
Sent: lunes, 25 de noviembre de 2002 11:13
To: ASPX_Professional
Subject: [aspx_professional] RE: app path
Hi there
Server.MapPath is a memeber of the HttpServerUtility class in the
System.Web namespace.
Be careful to spell it correctly if you're using C# (case sensitive) or
if you're set Option Strict On in Vb.NET.
It will return a string of the entire physical path, e.g.
string pathToImage =3D Server.MapPath("images/trans.gif");
pathToImage would be return the following:
C:\Inetpub\wwwroot\images\trans.gif
Phil
-----Original Message-----
From: DT-Rene Vazquez [mailto:renevazquez@c...]
Sent: 25 November 2002 16:06
To: ASPX_Professional
Subject: [aspx_professional] RE: app path
Hi, thanks a lot, the Server class is located in which namespace? And
another question: It is obligatory to give the path to the method or it
is possible that the method return the path of the current executing
aspx page?
Sorry for my English, thanks...
-----Original Message-----
From: David Reckner [mailto:dreckner@r...]
Sent: lunes, 25 de noviembre de 2002 10:26
To: ASPX_Professional
Subject: [aspx_professional] RE: app path
Try Server.Mappath
Regards,
David Reckner
-----Original Message-----
From: DT-Rene Vazquez [mailto:renevazquez@c...]
Sent: Monday, November 25, 2002 10:28 AM
To: ASPX_Professional
Subject: [aspx_professional] app path
Hi, I used explicit path for accesing files within my web forms
application. For example I use one xml file and I locate it like this:
Fields.Load("c:\\inetpub\\wwwroot\\RMAapp\\RMAapp_WebUI\\RMAFields.xml")
But of course this only works if my app is in the inetpub directory, but
if I create my application from a virtual folder this wouldn't work. I'm
sure this is very simple, but I cannot find out how can I make my path
relative to my app root wherever it is.
Thanks a lot for any help in advance.
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.419 / Virus Database: 235 - Release Date: 11/13/2002
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.419 / Virus Database: 235 - Release Date: 11/13/2002
|
|
 |