C# C# Console Application

C# Get All Files in Directory and Subdirectories2 min read

Here is just a little tutorial to list all the files in a folder (and its subfolders).

List all the files in a folder (and its subfolders): ‘allFiles’ is my StringCollection containing the complete list of all files
Why a StringCollection? Because arrays have a fixed size and using a StringCollection is the only way to list all the folder and subfolder files and ‘path’ the selected folder

C# Code and Comment

Output:




Leave a Comment