Community Forums Archive

Go Back

Subject:Exclude some directories in a loop
Posted by: bejj
Date:10/19/2012 6:31:34 PM

Hi,

I have a loop that works perfectly well for opening all .wav files in a directory (and its subdirectories !) :

string[] fileHolder = Directory.GetFiles("D:\\Temp","*.wav",SearchOption.AllDirectories);

--

How to exlcude files coming from some subdirectories ?

Example :
I want to browse all "D:\Temp" and its subdir, but not the subdirectories which has "Hoho" in its name...


Thanks in advance!
bejj

Go Back