Click or drag to resize

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
public static bool IsPathRooted(
	string 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, .
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".
This method does not verify that the path or file name exists.
See Also