Results 1 to 3 of 3

Thread: Reading A File Into Listbox

  1. #1

    Thread Starter
    Member davethebrat's Avatar
    Join Date
    Jul 2001
    Location
    Buffalo, NY
    Posts
    51

    Reading A File Into Listbox

    How do I read a file into a listbox? I am making a playlist creater in my application. But im not sure how to read the *.m3u file into listbox. ***note: it reads just like a *.txt file...any idea's how?

    Also, is there a way retrieve your online buddys through an API from AOL Instant Messenger or send IM's through API???

    Thanx People!

  2. #2
    I have no idea about the AOL thing. But for the first, just go line by line (Print #1, MyString) and add into the listbox (lstBox.AddElement MyString).

  3. #3
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    Try this:
    VB Code:
    1. Dim intFileNo As Long
    2. Dim strLine As String
    3.  
    4. intFileNo = FreeFile
    5.  
    6. Open "c:\mp3.txt" For Input As #intFileNo
    7. Do While Not EOF(intFileNo)
    8.     Line Input #intFileNo, strLine
    9.     List1.AddItem strLine
    10. Loop
    This assumes each filename is on a different line...e.g;

    Sound1.mp3
    Sound2.mp3
    Sound3.mp3
    ....

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