-
September 1st, 2013, 04:59 AM
#1
Using Directory.GetFiles() WITH multiple extensions AND sort order
Hi,
I have to get a directory file list, filtered on multiple extensions...and sorted!
I use this, which is the fastest way I've found to get dir content filtered on multiple extensions:
Code:
Dim ext As String() = {"*.jpg", "*.bmp","*png"}
Dim files As String() = ext.SelectMany(Function(f) Directory.GetFiles(romPath, f)).ToArray
Array.Sort(files)
and then use an array sort.
I was wondering (and this is my question ) if there would be a way to do the sorting IN the same main line? A kind of:
Code:
Dim files As String() = ext.SelectMany(Function(f) Directory.GetFiles(romPath, f).Order By Name).ToArray
and, if yes, if I would gain speed doing this instead of sorting the array at the end (but I would do my test and report..as soon as I get a solution!!)?
Thanks for your help!!
-
September 1st, 2013, 08:19 PM
#2
Re: Using Directory.GetFiles() WITH multiple extensions AND sort order
or, just shell EXPLORER with the parameters
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
|