Public Class Form1 Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click Dim sr As IO.StreamReader = IO.File.OpenText("C:\Documents and Settings\Dominicus\Desktop\posts.txt") Dim counter As Integer Do While sr.Peek <> -1 Dim line As String line = sr.ReadLine() If line.Substring(0, 8) = "Posted by:" Then counter += 1 End If Loop sr.Close() lstResults.Items.Add("The number of posts is " & counter) End Sub End Class