Method IsParentOf
IsParentOf(DirectoryInfo, DirectoryInfo)
Checks if a given path is a parent directory of another.
Declaration
public static bool IsParentOf(this DirectoryInfo parentDir, DirectoryInfo candidatePath)
Parameters
| Type | Name | Description |
|---|---|---|
| DirectoryInfo | parentDir | Potential parent directory path. |
| DirectoryInfo | candidatePath | Potential child directory path. |
Returns
| Type | Description |
|---|---|
| bool | Boolean value indicating whether the candidatePath is a child of parentDir. |
Examples
IsParentDir("C:\\temp\\file", "C:\\temp"); //Returns true