I'm trying to check whether a directory is in a format of
Ex:
This should be valid: D:\TESTDIR\FOLDER1\FOLDER2\Somerandomfiles
This is not valid: D:\TESTDIR\FOLDER1\Somerandomfiles
Basically I need to make sure that for every folder there should be a subfolder inside. note that a single folder may contain multiple subfolder. Then the subfolder will contain the files such as text files/pdf files etc.
//not sure how/where to place to check if folder has a subfolder
var _dir = Directory.GetDirectories(@"D:\TESTDIR");
foreach(var _folder1 in _dir)
{
// check if contains folder2? if not
// MessageBox.Show(folder1name);
var _folder2 = Directory.GetDirectories(_folder1);
foreach (var _path in _folder2)
{
// do something
}
}