You'll need to import the 'IO' namepsace.
Code:
Imports System . IO
The following will show a save file dialog where you can select where to save the text file to. The save part is from the post above.
Code:
Using SFD As New SaveFileDialog
If SFD.ShowDialog() = DialogResult.Ok Then
SFD.Filter = "Text File (*.txt) | *.txt"
Dim Contents As New List(Of String)
For Each Item As Object In ListBox1.Items
contents.Add(Item.ToString())
Next
File.WriteAllLines(SFD.FileName, Contents.ToArray())
End If
End Using