How do I use wildcards in C# to list down files contained in a selected folder?
Directory.GetFiles is your friend here:
Directory.GetFiles
Directory.GetFiles(@"C:UsersMeDocuments", "*.docx");
or, recursively:
Directory.GetFiles( @"C:UsersMeDocuments", "*.docx", SearchOption.AllDirectories);
2.1m questions
2.1m answers
60 comments
57.0k users