VirtualPathUtility.GetExtension Method
.NET Framework 3.0
Retrieves the extension of the file that is referenced in the virtual path.
Namespace: System.Web
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
public static String GetExtension ( String virtualPath )
public static function GetExtension ( virtualPath : String ) : String
Not applicable.
Parameters
- virtualPath
The virtual path.
Return Value
The file name extension string literal, including the period (.), a null reference (Nothing in Visual Basic), or an empty string ("").| Exception type | Condition |
|---|---|
| virtualPath contains one or more characters that are not valid, as defined in InvalidPathChars. |
The following code example demonstrates how to use the GetFileName, GetExtension, and GetDirectory methods.
Community Additions
ADD
Show: