|
-
Aug 7th, 2002, 11:49 PM
#1
Thread Starter
Member
Directory.GetFiles - how to use multiple file filters?
Hi all...
I'm writing a very simple MP3 player as a learning exercise in various .Net technologies. The app allows the user to enter a directory name containing the audio files they want to load. I also allow the user to specify one or both of "*.mp3" or "*.wma" as the file extensions... but I can't work out how to return matching files without using the FileOpen dialog which I want to avoid.
eg: What I have now is...
dir = "F:\mp3\test"
filter = "*.mp3|*.wma"
Dim foundFiles As String()
foundFiles = Directory.GetFiles(dir, filter)
If the user selects only MP3 **OR** WMA then it works fine but if they select both (so the filter = "*.mp3|*.wma" as above) it returns nothing since the filter obviously matches no files.
So my Q is how can I get the filesystem to return me a list of files that match a filter containing multiple file types without using the FileOpen dialog?
TIA...
Mike.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|