| Snippet | Conversions | .NET 1.1 | ASP.NET |
SummaryHow do I get the application path in an ASP.NET application? |
Retrieve the application pathstring appPath = HttpContext.Current.Request.ApplicationPath;
|
This property returns the virtual application path.
An empty string indicates that the application is at the root of the website.
Other examples might be:
/c4 /myapplication /myapps/AppNumberOne
|
Convert virtual application path to a physical pathstring physicalPath = HttpContext.Current.Request.MapPath(appPath);
|
Examples:C:\inetpub\wwwroot\myweb\c4 C:\inetpub\wwwroot\myweb\myapplication C:\inetpub\wwwroot\myweb\myapps/AppNumberOne |
|