c# program to list all the directory and list of a directory 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);