What is the syntax for setting multiple file-extensions as searchPattern on Directory.GetFiles()? For example filtering out files with .aspx and .ascx extensions.
// TODO: Set the string 'searchPattern' to only get files with
// the extension '.aspx' and '.ascx'.
var filteredFiles = Directory.GetFiles(path, searchPattern);
Update: LINQ is not an option, it has to be a searchPattern passed into GetFiles, as specified in the question.
I believe there is no “out of the box” solution, that’s a limitation of the Directory.GetFiles method.
It’s fairly easy to write your own method though, here is an example.
The code could be: