get the full file path

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ken

    #1

    get the full file path

    I have application files under "C:\$\TestA pp".
    there is a test.xml file under "C:\$\TestApp\t est.xml"
    I made a virtural directory in IIS as "TestApp"

    currently in application, "Request.MapPat h( string)" is used to get the full
    filepath.
    the result is like @"c:\inetpub\ww wroot\TestApp\t est.xml"
    but the real path is @"c:$\TestApp\t est.xml".

    What should I use to get the real path?

    Thanks


  • Scott M.

    #2
    Re: get the full file path

    Server.MapPath( relativePath)


    "Ken" <klee@jeromegro up.comwrote in message
    news:etJodpIpHH A.5008@TK2MSFTN GP05.phx.gbl...
    >I have application files under "C:\$\TestA pp".
    there is a test.xml file under "C:\$\TestApp\t est.xml"
    I made a virtural directory in IIS as "TestApp"
    >
    currently in application, "Request.MapPat h( string)" is used to get the
    full filepath.
    the result is like @"c:\inetpub\ww wroot\TestApp\t est.xml"
    but the real path is @"c:$\TestApp\t est.xml".
    >
    What should I use to get the real path?
    >
    Thanks
    >
    >

    Comment

    • Ken

      #3
      Re: get the full file path

      the result is same as Request.MapPath (relativePath)

      "Scott M." <s-mar@nospam.nosp amwrote in message
      news:%23I%239b8 IpHHA.3736@TK2M SFTNGP03.phx.gb l...
      Server.MapPath( relativePath)
      >
      >
      "Ken" <klee@jeromegro up.comwrote in message
      news:etJodpIpHH A.5008@TK2MSFTN GP05.phx.gbl...
      >>I have application files under "C:\$\TestA pp".
      >there is a test.xml file under "C:\$\TestApp\t est.xml"
      >I made a virtural directory in IIS as "TestApp"
      >>
      >currently in application, "Request.MapPat h( string)" is used to get the
      >full filepath.
      >the result is like @"c:\inetpub\ww wroot\TestApp\t est.xml"
      >but the real path is @"c:$\TestApp\t est.xml".
      >>
      >What should I use to get the real path?
      >>
      >Thanks
      >>
      >>
      >
      >

      Comment

      • Cor Ligthert [MVP]

        #4
        Re: get the full file path

        Ken,

        Have a look at the path class
        http://msdn2.microsoft.com/en-us/lib...m.io.path.aspx

        Cor


        "Ken" <klee@jeromegro up.comschreef in bericht
        news:%23XlgdMJp HHA.2156@TK2MSF TNGP03.phx.gbl. ..
        the result is same as Request.MapPath (relativePath)
        >
        "Scott M." <s-mar@nospam.nosp amwrote in message
        news:%23I%239b8 IpHHA.3736@TK2M SFTNGP03.phx.gb l...
        >Server.MapPath (relativePath)
        >>
        >>
        >"Ken" <klee@jeromegro up.comwrote in message
        >news:etJodpIpH HA.5008@TK2MSFT NGP05.phx.gbl.. .
        >>>I have application files under "C:\$\TestA pp".
        >>there is a test.xml file under "C:\$\TestApp\t est.xml"
        >>I made a virtural directory in IIS as "TestApp"
        >>>
        >>currently in application, "Request.MapPat h( string)" is used to get the
        >>full filepath.
        >>the result is like @"c:\inetpub\ww wroot\TestApp\t est.xml"
        >>but the real path is @"c:$\TestApp\t est.xml".
        >>>
        >>What should I use to get the real path?
        >>>
        >>Thanks
        >>>
        >>>
        >>
        >>
        >
        >

        Comment

        Working...