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