HttpRequest.MapPath Method (String)
Maps the specified virtual path to a physical path.
Assembly: System.Web (in System.Web.dll)
Theproperty potentially contains sensitive information about the hosting environment. The return value should not be displayed to users.
The following code example uses themethod to convert a virtual path to a fully qualified physical path on the server. This example has two parts:
An .aspx page maps the path, reads the file, and displays results of the read operation.
A class, UpperCaseFilterStream, that changes all characters passed through it to uppercase.
The first part of the example shows how to convert a virtual path to a fully qualified physical path using the StreamReader object, which obtains the contents of the file. The Write method is then called to display the content of the file on the page. The Filter property is used to attach a filter to the response stream that makes the text displayed to the page all uppercase.method. This physical path is then passed to a
The second part of the example shows a class that inherits from Stream and converts all characters in a stream to uppercase. Put this code in the App_Code folder for your application.
Available since 1.1