Method to get all files within folder and subfolders that will return a list

You can use Directory.GetFiles to replace your method.

 Directory.GetFiles(dirPath, "*", SearchOption.AllDirectories)

Leave a Comment