Control.MapPathSecure Method (String)
.NET Framework (current version)
Retrieves the physical path that a virtual path, either absolute or relative, maps to.
Assembly: System.Web (in System.Web.dll)
Parameters
- virtualPath
-
Type:
System.String
A relative or root relative URL.
| Exception | Condition |
|---|---|
| ArgumentNullException | virtualPath is null or an empty string (""). |
This method can only be used by server controls that have permissions to read files and which are part of fully trusted .dll files, such as System.Web.dll. This helps prevent security breaches.
The following example uses the MapPathSecure method to obtain the physical path of a virtual directory of the containing Page or UserControl object.
.NET Framework
Available since 1.1
Available since 1.1
Show: