Default path and root website for opening xml document?

  • Thread starter Thread starter yburtin
  • Start date Start date
Y

yburtin

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
*-----------------------*
 
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
 
Back
Top