Ok, I wrote a code because it was easier than hunting down the project so here is what I got:
vb Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'I used try simply because I have my original write function here
'but it is always a good idea to have a try-catch when accessing
'files.
Try
'Create a list of strings from the file
Dim iCount As New List(Of String)(IO.File.ReadAllLines("Test.txt"))
'Count how many items are in the list and
'react accourdingly
If iCount.Count = 10 Then
'Remove the first item from iCount
iCount.RemoveAt(0)
'Add the new time stamp to the bottom
iCount.Add(My.Computer.Clock.LocalTime)
'If the count isn't 10 then you want to just add a new item
Else
iCount.Add(My.Computer.Clock.LocalTime)
End If
'Write the new values to the text file
IO.File.WriteAllLines("Test.txt", iCount)
'Catch your exceptions
'I just had mine write the file with the current time
Catch ex As IO.FileNotFoundException
IO.File.WriteAllText("Test.txt", My.Computer.Clock.LocalTime)
End Try
'This line was for debugging, it displays the text
'So I could count the lines
TextBox1.Text = IO.File.ReadAllText("Test.txt")
End Sub
Feel free to take the example and adapt it how you need.