Results 1 to 6 of 6

Thread: Getting all of a certain file type

  1. #1

    Thread Starter
    Hyperactive Member flame_211's Avatar
    Join Date
    Jun 2000
    Location
    I dont really think I know where I am???
    Posts
    393

    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
    Reach me at:
    AIM: FlameWide
    AIM: Itz deep6
    MSN/Email: [email protected]

    Check out these sites:
    My Blog

  2. #2
    Frenzied Member nishantp's Avatar
    Join Date
    Jan 2001
    Location
    Where you least expect me to be
    Posts
    1,375
    VB Code:
    1. Function DirList(strDir As String) As String()
    2.     'returns a 0 based array with the files in strDir
    3.     'Can contain a pattern such as "*.*"
    4.     Dim Count As Integer
    5.     Dim sFiles() As String
    6.     Dim sFile As String
    7.    
    8.     sFile = Dir$(strDir)
    9.     Count = -1
    10.     Do
    11.         Count = Count + 1
    12.         ReDim Preserve sFiles(Count)
    13.         sFiles(Count) = sFile
    14.         sFile = Dir$
    15.     Loop
    16.     DirList = sFiles
    17. 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.

  3. #3

    Thread Starter
    Hyperactive Member flame_211's Avatar
    Join Date
    Jun 2000
    Location
    I dont really think I know where I am???
    Posts
    393

    Thanks...

    Thank you, Although I dont have VB6 I will try it anyways...


    -Andrew
    Reach me at:
    AIM: FlameWide
    AIM: Itz deep6
    MSN/Email: [email protected]

    Check out these sites:
    My Blog

  4. #4
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Won't a FileListBox be useful?
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  5. #5
    Frenzied Member numtel's Avatar
    Join Date
    Apr 2000
    Location
    CA
    Posts
    1,163
    it would be the easiest way, just make it hidden.

  6. #6

    Thread Starter
    Hyperactive Member flame_211's Avatar
    Join Date
    Jun 2000
    Location
    I dont really think I know where I am???
    Posts
    393

    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
    Reach me at:
    AIM: FlameWide
    AIM: Itz deep6
    MSN/Email: [email protected]

    Check out these sites:
    My Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width