467,207 Members | 1,368 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,207 developers. It's quick & easy.

Default path and root website for opening xml document?

Hi,

I'm currently working on a dotnet web application and here is the
problem I have:

On my computer (french version of xp pro), I have my webserver
installed. Inside one of my webpages, I open an XML file
who is located on the root website:

XmlDocument _XmlParametres = new XmlDocument( );
try
{
_XmlParametres.Load( "Parametres.xml" );
}
....

I don't put a path before the name of the xmlfile so it opens the file
in the root website. If I build a setup, put my
pages on a server (windows 2000 server english version), instead of
looking inside the root directory, it goes
inside system32 directory to try to find the xml document.
If anyone has an idea, it would be welcome

Thank's

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
Nov 18 '05 #1
  • viewed: 1474
Share:
2 Replies
You can use ther Server.MapPath function..

XmlDocument _XmlParametres = new XmlDocument( );
try
{
_XmlParametres.Load( Server.MapPath("Parametres.xml" ));
}

I hope this helps!

Joel Cade, MCSD
Fig Tree Solutions, LLC
http://www.figtreesolutions.com

"yburtin" wrote:
Hi,

I'm currently working on a dotnet web application and here is the
problem I have:

On my computer (french version of xp pro), I have my webserver
installed. Inside one of my webpages, I open an XML file
who is located on the root website:

XmlDocument _XmlParametres = new XmlDocument( );
try
{
_XmlParametres.Load( "Parametres.xml" );
}
....

I don't put a path before the name of the xmlfile so it opens the file
in the root website. If I build a setup, put my
pages on a server (windows 2000 server english version), instead of
looking inside the root directory, it goes
inside system32 directory to try to find the xml document.
If anyone has an idea, it would be welcome

Thank's

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*

Nov 18 '05 #2
Thank's, it works! :)

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Matt Walker | last post: by
2 posts views Thread by jpb | last post: by
1 post views Thread by js | last post: by
4 posts views Thread by Win, Pats | last post: by
4 posts views Thread by Nobody | last post: by
6 posts views Thread by John Kotuby | last post: by
13 posts views Thread by lawpoop@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.