Hi,
Try this:
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
ListBox1.Items.Add("Error1")
ListBox1.Items.Add("Error2")
ListBox1.Items.Add("Error3")
ListBox1.Items.Add("Error4")
ListBox1.Items.Add("Error5")
Dim FS As New FileStream("C:\ErrorLog.log", FileMode.OpenOrCreate, FileAccess.ReadWrite)
Dim SW As New StreamWriter(FS)
SW.AutoFlush = True
For Each itm As String In ListBox1.Items
SW.WriteLine(Now() & vbTab & itm)
Next
Try
SW.Dispose()
FS.Close()
FS.Dispose()
Catch ex As Exception
End Try
End Sub
This produces this:
14/05/2015 14:30:07 Error1
14/05/2015 14:30:07 Error2
14/05/2015 14:30:07 Error3
14/05/2015 14:30:07 Error4
14/05/2015 14:30:07 Error5