Wednesday, March 28, 2012

System.IO.Directory.GetFiles(path, searchPattern)

Hi

I don't know if this is the right place to put this post but I didn't found anywhere else.

The thing is that I'm getting files in a directory but I would like to pick only four types of files: .wmv, .avi, .mpeg and .mpg. I know that the search pattern works but I can only search for one type of file. Can extend the search to look for all 4 types?

Thx

It seems that there is no direct way to do this, really strange. Maybe you can get all files under the directory, and then use regular expression to get files of these types?

Hi

Thx for the reply. I already thought of that. I know it works cause I tried it. I just wanted another way to optimize unnecessary code. But thanks anyway lori_Jay

0 comments:

Post a Comment