IsPathRooted Method
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Gets a value indicating whether the specified path string contains a root.
Namespace: System.IO
Assembly: System.IO (in System.IO.dll)
Syntax
'Declaration
Public Shared Function IsPathRooted ( _
path As String _
) As Boolean
public static bool IsPathRooted(
string path
)
public:
static bool IsPathRooted(
String^ path
)
static member IsPathRooted :
path:string -> bool
public static function IsPathRooted(
path : String
) : boolean
Parameters
- path
Type: System. . :: . .String
The path to test.
Return Value
Type: System. . :: . .Boolean
true if path contains a root; otherwise, false.
Remarks
The IsPathRooted method returns true if the first character is a directory separator character such as "\", or if the path starts with a drive letter and colon (:). For example, it returns true for path strings such as "\\MyDir\\MyFile.txt", "C:\\MyDir", or "C:MyDir". It returns false for path strings such as "MyDir".
This method does not verify that the path or file name exists.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.