Click or drag to resize

PathIsPathRooted Method (String, Boolean)

[AlphaFS] 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,
	bool checkInvalidPathChars
)

Parameters

path
Type: SystemString
The path to test. The path cannot contain any of the characters defined in GetInvalidPathChars.
checkInvalidPathChars
Type: SystemBoolean
will check path for invalid path characters.

Return Value

Type: Boolean
if path contains a root; otherwise, .
Exceptions
Remarks
The IsPathRooted method returns true 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 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