Returns the root portion of the specified path.
[Visual Basic] Public Shared Function GetDirectoryRoot( _ ByVal path As String _ ) As String [C#] public static string GetDirectoryRoot( string path ); [C++] public: static String* GetDirectoryRoot( String* path ); [JScript] public static function GetDirectoryRoot( path : String ) : String;
The root portion of the specified path.
Exception Type | Condition |
---|---|
ArgumentException | path is empty or contains only whitespaces. |
SecurityException | The caller does not have the required permission. |
The resulting string consists of those leftmost characters of the path that constitute the root of the path. Possible patterns for the resulting string are the following:
NGWS Runtime Security:
FileIOPermissionAccess | Read permission to the path. |