I have to check, if directory on disk is empty. It means, that it does not contain any folders/files. I know, that there is a simple method. We get array of FileSystemInfo\'
public static bool DirectoryIsEmpty(string path)
{
if (System.IO.Directory.GetFiles(path).Length > 0) return false;
foreach (string dir in System.IO.Directory.GetDirectories(path))
if (!DirectoryIsEmpty(dir)) return false;
return true;
}