Get Files of certain extension(s) in C#To get files of a specific extension in C# you can use
Directory.EnumerateFiles()method which returns an enumerable collection of full file names that meet specified criteria. Then you can iterate and loop through the enumerable using
ExampleIn below example we created a list of extension
ext, this list will be used in lambda expression
Where()to filter to required extensions.