Results 1 to 3 of 3

Thread: [RESOLVED][2008]FileWriteline how read write listbox to file?

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2008
    Posts
    74

    Resolved [RESOLVED][2008]FileWriteline how read write listbox to file?

    this is interesting again, i have been trying this for the past 6 hours without zero progress..

    So my question does vb have this at all, becaus eI searched & I cant find nothing that i can make to work at all?
    Code:
     filewriteline(filename,"text",linenr)
     filereadline (filename,"text",linenr)
    basically i have a listbox & i want to save all listbox items into txt file so i can load them back again lather. well this is what i have & its not really working:

    this is how I load items from txt file to listbox But sometimes its working(putting item on next listbox line) & sometimes not its like magic really..:
    Code:
                Dim file_name As String = load_listbox
                Dim stream_reader As New IO.StreamReader(file_name)
    
                ListBox1_include.Items.AddRange(Split(stream_reader.ReadToEnd, _
                    vbCrLf))
                ListBox1_include.SelectedIndex = 0
                stream_reader.Close()
    & this is how I write the listbox items to file:
    Code:
        '    For nr = 1 To ListBox1_include.Items.Count - 1
        '        'write all items into txt file
        '        My.Computer.FileSystem.WriteAllText(links_include, ListBox1_include.Items.Item(nr) & Chr(13), True)
        '    Next
    Last edited by goldenix; Apr 13th, 2008 at 08:57 AM.

    M.V.B. 2008 Express Edition

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