Hi im a beginner in vb.net. this is a console application. i would like to know how can i use system.timers.timer so that my application will check the file req.txt every 5 sec. any kind of help will do. here is my application.
Module Module1
Sub Main()
Dim FILE_NAME As String = "C:\Documents and Settings\Cathy\Desktop\req.txt"
Dim reqReader As New System.IO.StreamReader(FILE_NAME)
Dim aryTemp() As String 'array
Dim temp As String
Dim reqNum As String
Dim srcBldg As String
Dim dstBldg As String
Dim usrFneNum As String
Dim testNew As String = 0 ' how to make global? i would like to separate from the rest of the function so that it would no re initialized
Do While reqReader.EndOfStream = False
temp = reqReader.ReadLine()
aryTemp = temp.Split(":")
If testNew < aryTemp(0) Then
testNew = aryTemp(0)
reqNum = aryTemp(0)
srcBldg = aryTemp(1)
dstBldg = aryTemp(2)
usrFneNum = aryTemp(3)
'call validate()
'call algorithm()
Else
Continue Do
End If
Console.WriteLine("Nice " + reqNum + " " + srcBldg + " " + dstBldg + " " + usrFneNum)
Loop
'Console.WriteLine(reqReader.ReadToEnd.ToString)
'reqReader.Close()
'reqReader.Peek()
Console.ReadLine()
End Sub
End Module