|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
App DirectoryHow can we get the currently running WebApp directory? All kinds or Request.
don't work, maybe security..., the requests that work just show C:\Windows\System32, but I need the physical path of the WebApp to adjust some parameters in the running application after its start. I could include the string with the absolute path into the Web.Config but it's not so elegant and flexible and will require many corrections to the apps running in different directories. Is there any official way to get the physical directory where the app is located and runs from? Just D. Page.MapPath , is it what are you after?
Eliyahu "Just D." <no@spam.please> wrote in message news:IdAKf.26$kp3.11@fed1read03...Show quoteHide quote > How can we get the currently running WebApp directory? All kinds or > Request. don't work, maybe security..., the requests that work just show > C:\Windows\System32, but I need the physical path of the WebApp to adjust > some parameters in the running application after its start. I could > include the string with the absolute path into the Web.Config but it's not > so elegant and flexible and will require many corrections to the apps > running in different directories. Is there any official way to get the > physical directory where the app is located and runs from? > > Just D. > > Thanks, but actually not. I have already found the answer and cancelled the
question. It was strange for me that Request.PhysicalApplicationPath returns me the Windows System Directory, but later I understood that it should be requested not inside Global.asax.cs on ApplicationStart, but on the first aspx page, so it returned me a real physical path. Thanks anyway, Just D. Show quoteHide quote "Eliyahu Goldin" <removemeegol***@monarchmed.com> wrote in message news:uLOe0RsNGHA.3896@TK2MSFTNGP15.phx.gbl... > Page.MapPath , is it what are you after? > > Eliyahu > > "Just D." <no@spam.please> wrote in message > news:IdAKf.26$kp3.11@fed1read03... >> How can we get the currently running WebApp directory? All kinds or >> Request. don't work, maybe security..., the requests that work just show >> C:\Windows\System32, but I need the physical path of the WebApp to adjust >> some parameters in the running application after its start. I could >> include the string with the absolute path into the Web.Config but it's >> not so elegant and flexible and will require many corrections to the apps >> running in different directories. Is there any official way to get the >> physical directory where the app is located and runs from? >> >> Just D. >> >> > >
Other interesting topics
Web.config session timeout
ASP.NET 2.0 SmartNavigation vs MaintainScrollPositionOnPostback? sorting xml data in server control Need to add Button to DataList How to Comment an WebControl Type.GetType() <%# Bind("xxx") %> Documentation Shared Functionality Code behind displaying time for Online examinations in webapplications. |
|||||||||||||||||||||||