it always return path C:\winnt\system32 ..why ?

Discussion in 'ASP .Net' started by raagz, Jul 16, 2004.

  1. raagz

    raagz Guest

    Hi,

    can anybody tell me why
    the following piece of code in my ASP.NET page always returns the path
    as C:\winnt\system32 ?

    FileInfo objf = new FileInfo("test.xml");
    string strFile = objf.DirectoryName;


    Thanks
    Raagz
    raagz, Jul 16, 2004
    #1
    1. Advertising

  2. "raagz" <> wrote in message
    news:...
    > Hi,
    >
    > can anybody tell me why
    > the following piece of code in my ASP.NET page always returns the path
    > as C:\winnt\system32 ?
    >
    > FileInfo objf = new FileInfo("test.xml");
    > string strFile = objf.DirectoryName;


    Because that's the default directory of the aspnet_wp process.
    --
    John Saunders
    johnwsaundersiii at hotmail
    John Saunders, Jul 16, 2004
    #2
    1. Advertising

  3. raagz

    Ben Guest

    Look at Server.MapPath() maybe that will help??
    "raagz" <> wrote in message
    news:...
    > Hi,
    >
    > can anybody tell me why
    > the following piece of code in my ASP.NET page always returns the path
    > as C:\winnt\system32 ?
    >
    > FileInfo objf = new FileInfo("test.xml");
    > string strFile = objf.DirectoryName;
    >
    >
    > Thanks
    > Raagz
    Ben, Jul 16, 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. raagz
    Replies:
    0
    Views:
    310
    raagz
    Jul 16, 2004
  2. raagz
    Replies:
    0
    Views:
    314
    raagz
    Jul 16, 2004
  3. raagz
    Replies:
    0
    Views:
    293
    raagz
    Jul 16, 2004
  4. raagz
    Replies:
    0
    Views:
    340
    raagz
    Jul 16, 2004
  5. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,763
    Smokey Grindel
    Dec 2, 2006
Loading...

Share This Page