c# get all files in folder GetFiles exception code example
Example: c# list all files in a directory and subdirectory
string[] allfiles = Directory.GetFiles("path/to/dir", "*.*", SearchOption.AllDirectories);
string[] allfiles = Directory.GetFiles("path/to/dir", "*.*", SearchOption.AllDirectories);