0

I have used the below code to get the existence of different extension files in a drectory.

FileInfo[] projFiles = new string[] { "*.csproj", "*.vbproj", "*.master", "*.aspx", "*.config", "*.ascx", "*.resx" }.SelectMany(i => projectInfo.GetFiles(i, SearchOption.AllDirectories)).Distinct().ToArray();

And used the below code to get the files with path.

FileInfo[] csprojFiles =projectInfo.GetFiles("*.csproj", SearchOption.AllDirectories);
FileInfo[] vbprojFiles = projectInfo.GetFiles("*.vbproj", SearchOption.AllDirectories);
FileInfo[] masterFiles = projectInfo.GetFiles("*.master", SearchOption.AllDirectories);
FileInfo[] aspxFiles = projectInfo.GetFiles("*.aspx", SearchOption.AllDirectories);  

Could anyone please help me how to get the mutiple extension files with the path with single line of code as like what i did for existence of multiple extension files in a directory.

Thanks in Advance!!!

Karthi
  • 575
  • 2
  • 10
  • 29
  • Could anyone please provide your valuable suggestion on this? – Karthi Mar 16 '15 at 05:06
  • possible duplicate of [Can you call Directory.GetFiles() with multiple filters?](http://stackoverflow.com/questions/163162/can-you-call-directory-getfiles-with-multiple-filters) – Vladimir Mezentsev Mar 16 '15 at 05:34

0 Answers0