NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Directory.GetDirectoryRoot

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;

Parameters

path
The path of a file or directory.

Return Value

The root portion of the specified path.

Exceptions

Exception Type Condition
ArgumentException path is empty or contains only whitespaces.
SecurityException The caller does not have the required permission.

Remarks

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:

Requirements

NGWS Runtime Security:

FileIOPermissionAccess Read permission to the path.

See Also

Directory Class | Directory Members | System.IO Namespace