c# list all files in a directory and subdirectory

C#
string[] allfiles = Directory.GetFiles("path/to/dir", "*.*", SearchOption.AllDirectories);
Source

Also in C#: