I am trying to locate all image files in a particular folder. I use the
System.IO.DirectoryInfo to open information about the specific directory. I
am then trying to query all of the images in that folder whether the
extension be .jpg, gif, or bmp. So far I have not had any luck passing more
than one extension to 'GetFiles(String searchPattern). Is there a way to
pass more than one extension to this method?

Also is there a better way to search for files? Something more along the
lines of FindFirstFile from the Win32 API?

Thanks for the help

Brian

Re: Search for Files with System.IO.DirectoryInfo.GetFiles() by hirf-spam-me-here

hirf-spam-me-here
Fri Feb 27 08:49:06 CST 2004

* "Brian Reed" <breed2@logicon.com> scripsit:
> I am trying to locate all image files in a particular folder. I use the
> System.IO.DirectoryInfo to open information about the specific directory. I
> am then trying to query all of the images in that folder whether the
> extension be .jpg, gif, or bmp. So far I have not had any luck passing more
> than one extension to 'GetFiles(String searchPattern). Is there a way to
> pass more than one extension to this method?

You will have to perform multiple calls to 'GetFiles'.

> Also is there a better way to search for files? Something more along the
> lines of FindFirstFile from the Win32 API?

I don't think that this will be much faster than this:

<http://dotnet.mvps.org/dotnet/samples/filesystem/downloads/RecursiveFileScan.zip>

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>
Website Address Changed!