Default path and root website for opening xml document?

Discussion in 'ASP .Net' started by yburtin, Oct 25, 2004.

  1. yburtin

    yburtin Guest

    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
    *-----------------------*
    yburtin, Oct 25, 2004
    #1
    1. Advertising

  2. 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
    > *-----------------------*
    >
    =?Utf-8?B?Sm9lbCBDYWRl?=, Oct 25, 2004
    #2
    1. Advertising

  3. yburtin

    yburtin Guest

    RE: Default path and root website for opening xml document

    Thank's, it works! :)

    *-----------------------*
    Posted at:
    www.GroupSrv.com
    *-----------------------*
    yburtin, Oct 26, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve Carrow
    Replies:
    0
    Views:
    538
    Steve Carrow
    Jul 28, 2003
  2. Steve Carrow
    Replies:
    0
    Views:
    616
    Steve Carrow
    Jul 28, 2003
  3. Tony Prichard
    Replies:
    0
    Views:
    715
    Tony Prichard
    Dec 12, 2003
  4. AAaron123
    Replies:
    11
    Views:
    8,933
    AAaron123
    Mar 30, 2009
  5. Shawn McNiven

    how to find website root path

    Shawn McNiven, Mar 13, 2005, in forum: Javascript
    Replies:
    1
    Views:
    141
    Evertjan.
    Mar 13, 2005
Loading...

Share This Page