Writing listbox items into text file



Hi,
I can read from a text file and insert text file's contents into a
listbox whose format is line by line using this code:

Dim reader As String
reader = My.Computer.FileSystem.ReadAllText("c:
\bookmarks.txt")

Dim strs() As String
strs = Split(reader, Environment.NewLine)


For Each s As String In strs
ListBox1.Items.Add(s)
Next


But i also want to write all listbox items into text file "line by
line"? How can i do this?

I tried My.Computer.FileSystem.WriteAlltext but couldn't make out
completely.

I hope i learn.

Thanks!
.



Relevant Pages


Loading