Hello, I would like to know if anybody could help me with this program that im trying.
I have a text file with data inside and i want to display one data line per time with 2 sec delay.
The data should continue show infinitely.

This is what i have done until now

Private Sub Form_Load ()

tcpComm1.NodeIP = " "
tcpComm1.NodePort = "  "
tcpComm1.Link

Dim iFileNum As Integer
Dim FileText as String
Dim iLen As Integer


iFileNum = FreeFile
FileText="Text.txt"


Open FileText For Input As iFileNum


Do  While Not EOF (iFileNum)
Line Input #iFileNum, idata
tcpComm1.DataOutput (idata)


Loop


Close(iFileNum)



End Sub

Thanks,
Yiannis

Public Class Form1

    Private myFile() As String = IO.File.ReadAllLines("C:\!vb.net\temp.txt") '// load file.
    Private lineNumber As Integer = 0 '// keep track of which line to display.

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Interval = 2000 '// 2 second delay.
        Timer1.Start()
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If Not lineNumber = myFile.Count Then '// if not the end of the text file,
            TextBox1.Text = myFile(lineNumber) '// display line.
            lineNumber += 1 '// increase line number.
        Else
            lineNumber = 0 '// reset lines back to the first line.
        End If
    End Sub

End Class

Thanks codeorder for the reply.The program i want to connect with a lcd monitor through the internet thats why i had the tcpComm .So if i leave it as it will be ok?
Sorry if the question is silly but im new one with VB.net .

Thanks.

I have no references to using tcpComm, so I cannot "ok" your question.

Ok Codeorder Thank you

Hello there

I have a problem with the following code:

    Public Class Form1
    Private myFile() As String = IO.File.ReadAllLines("C:\!vb.net\temp.txt") '// load file.
    Private lineNumber As Integer = 0 '// keep track of which line to display.
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Timer1.Interval = 2000 '// 2 second delay.
    Timer1.Start()
    End Sub
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    If Not lineNumber = myFile.Count Then '// if not the end of the text file,
    TextBox1.Text = myFile(lineNumber) '// display line.
    lineNumber += 1 '// increase line number.
    Else
    lineNumber = 0 '// reset lines back to the first line.
    End If
    End Sub
    End Class

Everyng is ok and it reads the file line by line but only in the first line it doesnt jump to the 2nd 3rd line and so on

in my text file i have a list of names

John
Edward
Louis
James
Martin

How can i do with this code to show all the names in the textbox ?
I have made the textbox multyline already but all the names are shown only in the first line one after another is like if rewrites all the time name after name...

Please do not hijack threads. Especially old ones. Repost this as a new thread and I'll delete this one.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.