Results 1 to 2 of 2

Thread: Loading listbox with contents of text file[RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Posts
    162

    Exclamation Loading listbox with contents of text file[RESOLVED]

    I'm completely new to .net and kinda trying to fool around with it. i want to load a listbox with the contents of a text file and the code in VB6 would be something like:
    VB Code:
    1. dim strTemp as string
    2. Open App.Path + "\file.txt" For Input as #1
    3. Do While Not EOF(1)
    4. Line Input #1, strTemp
    5. List1.AddItem strTemp
    6. Wend
    Just wondering what the .Net equivalent would be.

    Plus, everytime I use the Application.StartUpPath + "\file.txt" it always says it cannot find the file.
    Any help would be greatly appreciated.
    Last edited by SuperChris9; Feb 9th, 2004 at 02:08 PM.

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