Eine .txt Datei z.B.:
1,2,3
wird in eine Listbox eingelesen.
Private Sub listboxload(ByVal Path As String, ByVal SplitChar As String)
Try
For Each Text As String In IO.File.ReadAllText(Path).Split(SplitChar)
ListBox1.Items.Add(Text)
Next
Catch ex As Exception
MessageBox.Show(ex.Message.ToString(), "Error")
End Try
End Sub
Kommentare zum Snippet