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
You can compare directory2 to directory1's Parent property when using a DirectoryInfo in both cases.
DirectoryInfo d1 = new DirectoryInfo(@"C:\Program Files\MyApp");
DirectoryInfo d2 = new DirectoryInfo(@"C:\Program Files\MyApp\Images");
if(d2.Parent.FullName == d1.FullName)
{
Console.WriteLine ("Sub directory");
}