I'm at work right now an can't check to see if this is right but try it an see
VB Code:
Public Function LogSize(ByVal pLog As String) As Long Try Dim sr As StreamReader = New StreamReader(pLog) Dim line As String, lines As Long line = sr.ReadLine() Do lines += 1 line = sr.ReadLine() Loop Until line Is Nothing sr.Close() return lines; Catch e As Exception ' In case of error MessageBox.Show("Exception Occurred: " & vbcrlf & e.Message) Return -1; End Try End Function




Reply With Quote