Reputation: 28443
I want to search a directory for all files that match a certain pattern. Surprisingly, I have not had to do this since vb6 (Dir)... I'm sure things have changed since then!
-Thanks
Upvotes: 5
Views: 470
Reputation: 25052
use SearchOption.AllDirectories parameter:
using System.IO;
Directory.GetFiles(@"C:\", "*.mp3", SearchOption.AllDirectories);
Upvotes: 11