Request ServerVariables Common Task

ASP.Net Get physical path to executing script

Retrieve the full physical path to the script that is executing.
When requesting "www.SomeWebSite.com/customer/details.aspx" you want "D:\WebSites\SomeWebSite\Root\Customer\details.aspx"
string pathToScript = Request.ServerVariables["PATH_TRANSLATED"];
Dim pathToScript As String = Request.ServerVariables("PATH_TRANSLATED")
Related ServerVariables PATH_TRANSLATED
     << Back