|
-
Nov 1st, 2001, 09:56 PM
#1
Thread Starter
Hyperactive Member
Getting all of a certain file type
How do I get all of a certain file type into a list box with its path?
(i.e. say im making a music player, how do I get all *.mp3 files or all *.wav files(or both) into one list box with its path(i.e. C:\windows\desktop\music\whatever.mp3)) any help would be greatly appreciated
-Andrew
-
Nov 1st, 2001, 10:03 PM
#2
Frenzied Member
VB Code:
Function DirList(strDir As String) As String()
'returns a 0 based array with the files in strDir
'Can contain a pattern such as "*.*"
Dim Count As Integer
Dim sFiles() As String
Dim sFile As String
sFile = Dir$(strDir)
Count = -1
Do
Count = Count + 1
ReDim Preserve sFiles(Count)
sFiles(Count) = sFile
sFile = Dir$
Loop
DirList = sFiles
End Function
Thats not a complete solution, that will only get certain files frmo 1 folder, however, i hope it helps. BTW u need VB6 for that to work.
You just proved that sig advertisements work.
-
Nov 1st, 2001, 10:11 PM
#3
Thread Starter
Hyperactive Member
Thanks...
Thank you, Although I dont have VB6 I will try it anyways...
-Andrew
-
Nov 1st, 2001, 10:13 PM
#4
-
Nov 1st, 2001, 10:18 PM
#5
Frenzied Member
it would be the easiest way, just make it hidden.
-
Nov 2nd, 2001, 10:36 AM
#6
Thread Starter
Hyperactive Member
Yeah...
If I was going to do it for one folder(I know how to do that) But I want to do it for the hole computer(Every single *.txt file or *.mp3... doesnt even have to have a * in it(the code) it could just be .mp3)
Thanks for the help sofar...
-Andrew
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
|