PathIsPathRooted Method (String) |
Gets a value indicating whether the specified path string contains absolute or relative path information.
Namespace:
Alphaleonis.Win32.Filesystem
Assembly:
AlphaFS (in AlphaFS.dll) Version: 2.2
Syntax public static bool IsPathRooted(
string path
)
Public Shared Function IsPathRooted (
path As String
) As Boolean
public:
static bool IsPathRooted(
String^ path
)
static member IsPathRooted :
path : string -> bool
Parameters
- path
- Type: SystemString
The path to test. The path cannot contain any of the characters defined in GetInvalidPathChars.
Return Value
Type:
Boolean if
path contains a root; otherwise,
.
Exceptions Remarks
The IsPathRooted method returns
if the first character is a directory separator character such as
DirectorySeparatorChar, or if the path starts with a drive letter and colon (
VolumeSeparatorChar).
For example, it returns true for path strings such as "\\MyDir\\MyFile.txt", "C:\\MyDir", or "C:MyDir".
It returns
for path strings such as "MyDir".
Remarks This method does not verify that the path or file name exists.
See Also