Results 1 to 2 of 2

Thread: Help!

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    33
    Im attempting to write a program to make mp3 playlists, i know theres lots of em out there, but i get bored fast. Anyway, all is well, but i cannot figure out how to get a list of files from a directory e.g.

    Directory:
    c:\server\biohazard\mata leao\

    Files in the Directory:
    (Biohazard) 01. Authority
    (Biohazard) 02. These Eyes (Have Seen)
    ...etc.

    i want to be able to browse the directories from vb and when i select a group of mp3s to be able to get their full names e.g.
    c:\server\biohazard\mata leao\(Biohazard) 01. Authority
    c:\server\biohazard\mata leao\(Biohazard) 02. These Eyes (Have Seen)

    if this isnt possible by any means you know of is there any way to get long file names from the short file names?

    Thank You In Advance,
    Jeff

  2. #2
    Guest
    i don't think Microsoft would have gotten this far if this wasn't possible!

    use the FileSystemObject:
    (add a reference to it in your project)
    Code:
    Dim MyFSO as new filesystemobject
    dim MyFolder as folder
    dim MyFile as file
    
    On Error Resume Next
    Set MyFolder = MyFSO.GetFolder("C:\Windows")
    
    For Each MyFile In MyFolder.Files
        List1.AddItem Mid$(MyFile.Name, 1, (InStr(MyFile.Name, ".") - 1))
    Next MyFile
    i just took this bit of code out of a recent application that I did, it puts each filename in the windows dir into a listbox.

    If i remember right, there is a function of the FSO that is called something like "GetLongFilename" or something, check it out.

    PS don't use the DIR() function in this situation because its very messy (in my opinion ).

    Mail me for more clarification


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