forum

home / developersection / forums / can you call directory.getfiles() with multiple filters?

Can you call Directory.GetFiles() with multiple filters?

Anonymous User 3871 14-Nov-2013

I am trying to use the Directory.GetFiles() method to retrieve a list of files of multiple types, such as mp3's and jpg's. I have tried both of the following with no luck:

Directory.GetFiles("C:\\path", "*.mp3|*.jpg", SearchOption.AllDirectories);

Directory.GetFiles("C:\\path", "*.mp3;*.jpg", SearchOption.AllDirectories);

Is there a way to do this in one call?


c# c# 
Updated on 14-Nov-2013

I am a content writter !

Can you answer this question?

Answer

1 Answers

Liked By