PathGetPathRoot Method (String, Boolean) |
[AlphaFS] Gets the root directory information of the specified path.
Namespace: Alphaleonis.Win32.FilesystemAssembly: AlphaFS (in AlphaFS.dll) Version: 2.0
Syntax public static string GetPathRoot(
string path,
bool checkInvalidPathChars
)
Public Shared Function GetPathRoot (
path As String,
checkInvalidPathChars As Boolean
) As String
public:
static String^ GetPathRoot(
String^ path,
bool checkInvalidPathChars
)
static member GetPathRoot :
path : string *
checkInvalidPathChars : bool -> string
Parameters
- path
- Type: SystemString
The path from which to obtain root directory information. - checkInvalidPathChars
- Type: SystemBoolean
will check path for invalid path characters.
Return Value
Type:
StringReturns the root directory of path, such as "C:\", or if path is
,
or an empty string if path does not contain root directory information.
Exceptions Exception | Condition |
---|
ArgumentException | The path parameter contains invalid characters, is empty, or contains only white spaces. |
See Also