Pattern searching for file extensions in c#
Posted on 2013-10-27
I have to go through a set of files and see if the extension meets a specific pattern.
Below is the pattern of files that I am currently looking for:
"*.pst *.ost *.e0* *.l0* *.ghs *.gho *.7z *.7z.* *.exp *.ilk *.res *.trg *.tlh *.idb *.pdb *.pch *.opt *.lib *.cab *.mov *.psp *.bmp *.chi *.chm *.com *.dll *.exe *.gif *.png *.hlp *.ivi *.ivt *.ix *.msi *.nls *.obj *.ocx *.rmi *.sys *.tif *.tmp *.ttf *.vbx *.wav *.wpg DRVSPACE.* *.iso *.pdb *.mpeg *.mpg *.ram *.rm *.ai *.aif *.aiff *.bin *.hqx *.snd *.mpe *.wmv *.wma *.xfd *.db *.m4v"
I know Directory.GetFiles has a pattern option. However it will only let me specify one at a time. I would like to go through each file individually, then check the extension then do any needed reporting on it.
Any input would be greatly appreciated.