You can use Directory.GetFiles to replace your method.
Directory.GetFiles(dirPath, "*", SearchOption.AllDirectories)
More Related Contents:
- Better way to check if a Path is a File or a Directory?
- How to get files in a relative path in C#
- Retrieving files from directory that contains large amount of files
- How do I get the directory from a file’s full path?
- Find all files in a folder
- How do I detect when a directory or file changes without constant scanning
- Delete files older than 3 months old in a directory using .NET
- Exclude certain file extensions when getting files from a directory
- C#: How to open Windows Explorer windows with a number of files selected
- C# Searching for files and folders except in certain folders
- How can i get ALL File Extentions in C#? [closed]
- Nested using statements in C#
- Use a variable from another method in C#
- Save and load MemoryStream to/from a file
- Referencing a variable from another method
- Inheritance from multiple interfaces with the same method name
- What is the difference between Directory.EnumerateFiles vs Directory.GetFiles?
- c# open file with default application and parameters
- DataAnnotations: Recursively validating an entire object graph
- Very Simple definition of InitializeComponent(); Method
- What’s the least invasive way to read a locked file in C# (perhaps in unsafe mode)?
- Is there a faster way than this to find all the files in a directory and all sub directories?
- How to do recursive descent of json using json.net?
- C# Delegate Instantiation vs. Just Passing the Method Reference [duplicate]
- Read random line from a file? c#
- Remove readonly attribute from directory
- C# – How to check if namespace, class or method exists in C#?
- .NET 4.5 file read performance sync vs async
- Encrypt SQLite database in C#
- c# open file, path starting with %userprofile%