Get Application Path

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Heidi Hundåla

    #1

    Get Application Path


    Hi !

    I am trying to find the application path dynamically,
    meaning the place on disc where my web app is residing, like some function
    that
    returns "C:\Inetpub\www root\MyApp\".

    Is there a funcion like that ?

    Regards,
    Heidi V. Hundåla
    heidi.hundala@n rk.no



  • John

    #2
    Re: Get Application Path

    On Sun, 14 Sep 2003 20:25:55 +0200, Heidi Hundåla wrote:
    [color=blue]
    > I am trying to find the application path dynamically, meaning the place on
    > disc where my web app is residing, like some function that
    > returns "C:\Inetpub\www root\MyApp\".
    >
    > Is there a funcion like that ?
    >[/color]

    Maybe try:

    System.Environm ent.CurrentDire ctory
    System.Environm ent.GetEnvironm entVariable(s)

    or some other System.Environm ent options might work, depending on what you
    are trying to do.

    Comment

    • Heidi Hundåla

      #3
      Re: Get Application Path

      System.Environm ent.CurrentDire ctory
      gave me C:\Windows\Syst em32\

      and how can
      System.Environm ent.GetEnvironm entVariable(s)
      work, what should the "s" be ?

      I want to find the path to where my app is on the C disc, meaning
      if my app is in C:\Inepub\wwwro ot\MyApplicatio n\
      then the function should return that exact path,
      "C:\Inepub\wwwr oot\MyApplicati on\".

      The natural thing would be Application.Pat h, but it doesn't exist.

      Regards,
      Heidi
      heidi.hundala@n rk.no


      "John" <Jeric@Sbcgloba lDotNetwork.NoS pam> wrote in message
      news:pan.2003.0 9.14.19.22.24.2 62165@Sbcglobal DotNetwork.NoSp am...[color=blue]
      > On Sun, 14 Sep 2003 20:25:55 +0200, Heidi Hundåla wrote:
      >[color=green]
      > > I am trying to find the application path dynamically, meaning the place[/color][/color]
      on[color=blue][color=green]
      > > disc where my web app is residing, like some function that
      > > returns "C:\Inetpub\www root\MyApp\".
      > >
      > > Is there a funcion like that ?
      > >[/color]
      >
      > Maybe try:
      >
      > System.Environm ent.CurrentDire ctory
      > System.Environm ent.GetEnvironm entVariable(s)
      >
      > or some other System.Environm ent options might work, depending on what you
      > are trying to do.[/color]


      Comment

      • Jon Davis

        #4
        Re: Get Application Path

        Hi, Heidi.

        Try:

        Request.Physica lApplicationPat h

        Jon

        "Heidi Hundåla" <heidi.hundala@ nrk.no> wrote in message
        news:uMe1j2ueDH A.616@TK2MSFTNG P11.phx.gbl...[color=blue]
        >
        > Hi !
        >
        > I am trying to find the application path dynamically,
        > meaning the place on disc where my web app is residing, like some function
        > that
        > returns "C:\Inetpub\www root\MyApp\".
        >
        > Is there a funcion like that ?
        >
        > Regards,
        > Heidi V. Hundåla
        > heidi.hundala@n rk.no
        >
        >
        >[/color]


        Comment

        • Jop Pascual

          #5
          Re: Get Application Path

          Server.MapPath( )

          --
          /jop


          "Heidi Hundåla" <heidi.hundala@ nrk.no> wrote in message
          news:uMe1j2ueDH A.616@TK2MSFTNG P11.phx.gbl...[color=blue]
          >
          > Hi !
          >
          > I am trying to find the application path dynamically,
          > meaning the place on disc where my web app is residing, like some function
          > that
          > returns "C:\Inetpub\www root\MyApp\".
          >
          > Is there a funcion like that ?
          >
          > Regards,
          > Heidi V. Hundåla
          > heidi.hundala@n rk.no
          >
          >
          >[/color]


          Comment

          • Heidi Hundåla

            #6
            Re: Get Application Path

            Thank's, it worked !

            Regards,
            Heidi

            "Jon Davis" <jon@REMOVE.ME. PLEASE.jondavis .net> wrote in message
            news:uKa87qxeDH A.2352@TK2MSFTN GP09.phx.gbl...[color=blue]
            > Hi, Heidi.
            >
            > Try:
            >
            > Request.Physica lApplicationPat h
            >
            > Jon
            >
            > "Heidi Hundåla" <heidi.hundala@ nrk.no> wrote in message
            > news:uMe1j2ueDH A.616@TK2MSFTNG P11.phx.gbl...[color=green]
            > >
            > > Hi !
            > >
            > > I am trying to find the application path dynamically,
            > > meaning the place on disc where my web app is residing, like some[/color][/color]
            function[color=blue][color=green]
            > > that
            > > returns "C:\Inetpub\www root\MyApp\".
            > >
            > > Is there a funcion like that ?
            > >
            > > Regards,
            > > Heidi V. Hundåla
            > > heidi.hundala@n rk.no
            > >
            > >
            > >[/color]
            >
            >[/color]


            Comment

            • Sean Chapman

              #7
              Re: Get Application Path

              quick one.. which namespace is Request in??
              "Jon Davis" <jon@REMOVE.ME. PLEASE.jondavis .net> wrote in message
              news:uKa87qxeDH A.2352@TK2MSFTN GP09.phx.gbl...[color=blue]
              > Hi, Heidi.
              >
              > Try:
              >
              > Request.Physica lApplicationPat h
              >
              > Jon
              >
              > "Heidi Hundåla" <heidi.hundala@ nrk.no> wrote in message
              > news:uMe1j2ueDH A.616@TK2MSFTNG P11.phx.gbl...[color=green]
              > >
              > > Hi !
              > >
              > > I am trying to find the application path dynamically,
              > > meaning the place on disc where my web app is residing, like some[/color][/color]
              function[color=blue][color=green]
              > > that
              > > returns "C:\Inetpub\www root\MyApp\".
              > >
              > > Is there a funcion like that ?
              > >
              > > Regards,
              > > Heidi V. Hundåla
              > > heidi.hundala@n rk.no
              > >
              > >
              > >[/color]
              >
              >[/color]


              Comment

              • Jon Davis

                #8
                Re: Get Application Path

                "HttpReques t" is in the System.Web namespace. However, the shortened
                "Request" is a property of the inherited System.Web.UI.P age object, so
                "Request" is the same as "this.Reque st".

                Jon


                "Sean Chapman" <schapman@inlan dkwpp.com> wrote in message
                news:bun9b.1477 $Y67.79754@news 2.telusplanet.n et...[color=blue]
                > quick one.. which namespace is Request in??
                > "Jon Davis" <jon@REMOVE.ME. PLEASE.jondavis .net> wrote in message
                > news:uKa87qxeDH A.2352@TK2MSFTN GP09.phx.gbl...[color=green]
                > > Hi, Heidi.
                > >
                > > Try:
                > >
                > > Request.Physica lApplicationPat h
                > >
                > > Jon
                > >
                > > "Heidi Hundåla" <heidi.hundala@ nrk.no> wrote in message
                > > news:uMe1j2ueDH A.616@TK2MSFTNG P11.phx.gbl...[color=darkred]
                > > >
                > > > Hi !
                > > >
                > > > I am trying to find the application path dynamically,
                > > > meaning the place on disc where my web app is residing, like some[/color][/color]
                > function[color=green][color=darkred]
                > > > that
                > > > returns "C:\Inetpub\www root\MyApp\".
                > > >
                > > > Is there a funcion like that ?
                > > >
                > > > Regards,
                > > > Heidi V. Hundåla
                > > > heidi.hundala@n rk.no
                > > >
                > > >
                > > >[/color]
                > >
                > >[/color]
                >
                >[/color]


                Comment

                • Jon Davis

                  #9
                  Re: Get Application Path

                  ... and by the way, if you need to know the HttpRequest object of the current
                  context but you're not in the context of a System.Web.UI.P age object, you
                  can try to obtain the HttpRequest object of the current context by using:

                  System.Web.Http Context.Current .Request

                  HTH,
                  Jon


                  "Jon Davis" <jon@REMOVE.ME. PLEASE.jondavis .net> wrote in message
                  news:uxFgvQ%23e DHA.2352@TK2MSF TNGP10.phx.gbl. ..[color=blue]
                  > "HttpReques t" is in the System.Web namespace. However, the shortened
                  > "Request" is a property of the inherited System.Web.UI.P age object, so
                  > "Request" is the same as "this.Reque st".
                  >
                  > Jon
                  >
                  >
                  > "Sean Chapman" <schapman@inlan dkwpp.com> wrote in message
                  > news:bun9b.1477 $Y67.79754@news 2.telusplanet.n et...[color=green]
                  > > quick one.. which namespace is Request in??
                  > > "Jon Davis" <jon@REMOVE.ME. PLEASE.jondavis .net> wrote in message
                  > > news:uKa87qxeDH A.2352@TK2MSFTN GP09.phx.gbl...[color=darkred]
                  > > > Hi, Heidi.
                  > > >
                  > > > Try:
                  > > >
                  > > > Request.Physica lApplicationPat h
                  > > >
                  > > > Jon
                  > > >
                  > > > "Heidi Hundåla" <heidi.hundala@ nrk.no> wrote in message
                  > > > news:uMe1j2ueDH A.616@TK2MSFTNG P11.phx.gbl...
                  > > > >
                  > > > > Hi !
                  > > > >
                  > > > > I am trying to find the application path dynamically,
                  > > > > meaning the place on disc where my web app is residing, like some[/color]
                  > > function[color=darkred]
                  > > > > that
                  > > > > returns "C:\Inetpub\www root\MyApp\".
                  > > > >
                  > > > > Is there a funcion like that ?
                  > > > >
                  > > > > Regards,
                  > > > > Heidi V. Hundåla
                  > > > > heidi.hundala@n rk.no
                  > > > >
                  > > > >
                  > > > >
                  > > >
                  > > >[/color]
                  > >
                  > >[/color]
                  >
                  >[/color]


                  Comment

                  Working...