[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