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