I have program which writes to database which folders are full or empty. Now I\'m using
bool hasFiles=false; (Directory.GetFiles(path).Length >0) ? hasFiles=
To check if any files exists inside the directory or sub directories, in .net 4, you can use method below:
public bool isDirectoryContainFiles(string path) { if (!Directory.Exists(path)) return false; return Directory.EnumerateFiles(path, "*", SearchOption.AllDirectories).Any(); }