There's not a way to do this with the default object.
The easiest way to do it may be something like:
You can obviously change that around a little bit to get the desired result. Ideally you could just inherit from the class and create your own, but the DirectoryInfo class is sealed.Code:string lookfor = "*.txt;*.zip;*.exe"; string[] extensions = lookfor.Split(new char[] {';'}); string mydirectory = @"c:\tmp"; ArrayList myfileinfos = new ArrayList(); DirectoryInfo di = new DirectoryInfo(mydirectory); foreach (string ext in extensions) { myfileinfos.AddRange(di.GetFiles(ext)); } FileInfo[] allfileinfo = myfileinfos.ToArray(typeof(FileInfo));




Reply With Quote