Multiple filetypes in Directory.GetFiles? 
Author Message
 Multiple filetypes in Directory.GetFiles?

Hi,
I wanted to load a list of all the JPG and GIF files into an array.
I was using the following to load JPGs only:
FilesInDir = System.IO.Directory.GetFiles(strCurrentFolder, "*.jpg")

I tried seperating the types with a comma:
FilesInDir = System.IO.Directory.GetFiles(strCurrentFolder, "*.jpg,*.gif")
And a semi-colon:
FilesInDir = System.IO.Directory.GetFiles(strCurrentFolder, "*.jpg;*.gif")

But niether of them work.  Is there an easy way to do this?
If not, I guess I could use a for loop, or something.

Thanks,
Joe



Sat, 05 Nov 2005 02:41:46 GMT  
 Multiple filetypes in Directory.GetFiles?
Hello,


Quote:
> I wanted to load a list of all the JPG and GIF files into an array.
> I was using the following to load JPGs only:
> FilesInDir = System.IO.Directory.GetFiles(strCurrentFolder, "*.jpg")

You must make multiple calls to GetFiles:

http://makeashorterlink.com/?T57B22F94

Regards,
Herfried K. Wagner
--
http://www.mvps.org/dotnet



Sat, 05 Nov 2005 02:51:12 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Directory.GetFiles() Question

2. Directory.GetFiles???

3. Rename multiple files within multiple directories

4. Access 95 Procedure to link application to multiple data mdb files in same directory

5. Watching Multiple directories with FileSystemWatcher

6. Multiple files from different directories in Listbox

7. VB6 Command Line Compile and Multiple Source Directories

8. searching multiple directories?

9. Looking For Multiple Directory Selection OCX

10. ---------- Installing a VB 4.0 app in multiple directories ----------

11. Installing a VB 4.0 app in multiple directories

12. VBRUN300.DLL needed in multiple directories?

 

 
Powered by phpBB® Forum Software