Private Sub CollectionToFile(ByVal sc As StringCollection, ByVal filename As String) Dim sw As StreamWriter = File.CreateText(filename) Dim i As Integer For i = 0 To sc.Count - 1 sw.WriteLine(sc(i)) Next i sw.Close() End Sub 'CollectionToFile
Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click Dim sc As New StringCollection() sc.Add(DateTime.Now.ToString()) sc.Add("http://www.SoftwareOnline.hu") CollectionToFile(sc, Application.StartupPath + "\test.txt") End Sub 'button1_Click