What is an easy way to check if directory 1 is a subdirectory of directory 2 and vice versa?
I checked the Path and DirectoryInfo helperclasses but found no system-r
Here's a simpler way to do it using the Uri class:
var parentUri = new Uri(parentPath); var childUri = new Uri(childPath); if (parentUri != childUri && parentUri.IsBaseOf(childUri)) { //dowork }