0
Dim line(10000) As String
Dim log_ctr As Integer
Open App.Path & "\data\log.txt" For Input Lock Read As #1
Do Until EOF(1)
Line Input #1, line(log_ctr)
log_ctr = log_ctr + 1
Loop
Close #1
If last_log <> log_ctr Then
For n = last_log To log_ctr - 1
Text1.SelStart = Len(Text1.Text)
Text1.SelText = line(n) & vbCrLf
End if
Next
last_log = log_ctr
End If

Can someone help me convert/translate this to VB 2010. Thank you very much.

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by emg31
0
Dim line As String = String.Empty
        Dim log_ctr As Integer = 0
        Dim readData As New System.IO.StreamReader("\data\log.txt")

        While readData.Read
            log_ctr += 1
        End While

        readData.Dispose()

        If last_log <> log_ctr Then
            For n = last_log To log_ctr - 1
                text1.SelectionStart = text1.Text.Length
            Next
        End If

Well this what I managed

1. last_log is never defined
2. What are u trying to do with line 12 in your code


Atleast define the problem a little so i can help u with more efficient code :)

0

@ Ankit, thank you very much for the reply and help
I was able to convert it using my friend "Google".
this script is part of my project for OpenVPN GUI, it should display the logs to a text box. but you can help me though on a pinger that will display the result in a text box in my form.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.