[VB] Writing ListBox content to an INI ?help?
Hello. I'm writing an application and I want to save all items from a ListBox to an INI file, I got this so far:
PHP Code:
Private Sub SavePathToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SavePathToolStripMenuItem.Click
Dim mystreamwriter As System.IO.StreamWriter
Dim saveFileDialog1 As New SaveFileDialog()
saveFileDialog1.Filter = "INI files (*.ini)|*.ini|All files (*.*)|*.*"
saveFileDialog1.CheckPathExists = True
saveFileDialog1.Title = "Save Paths"
saveFileDialog1.ShowDialog(Me)
Try
mystreamwriter = System.IO.File.AppendText(saveFileDialog1.FileName)
mystreamwriter.WriteLine(??????????)
mystreamwriter.Flush()
Catch ex As Exception
End Try
End Sub
Where there are ??????, there's my problem. If I do:
Code:
mystreamwriter.WriteLine(ListBox1.Items)
Outputs me this in the INI:
Code:
System.Windows.Forms.ListBox+ObjectCollection
What's wrong, can anybody help me?