M
Morten Snedker
I open a file for input. Each line is handled individually. Every time
a line has been handled I wish to wait for ½ second before reading the
next. Am I doing it right or wrong ? (I think it's wrong):
Dim thSleep As New Thread(AddressOf AppSleep)
Sub AppSleep()
Do
Thread.Sleep(500)
Loop
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim sr As StreamReader = New StreamReader("d:\test.txt")
Dim s As String = ""
Do While sr.Peek() >= 0
s = sr.ReadLine()
Console.WriteLine(s)
If s.Substring(0, 1) = "{" Then
s = s.Substring(1, s.Length - 2)
Dim myArray() As String = Split(s, ",", ,
CompareMethod.Text)
ClickPosition()
AppSleep()
Else
TextInput = s
WriteText()
AppSleep()
End If
Loop
sr.Close()
sr.Dispose()
End Sub
The essense is that for each line either a mouse click og textline i
send to another application. For each click/text I wish for the
application to "absorb" it.
Regards /Snedker
a line has been handled I wish to wait for ½ second before reading the
next. Am I doing it right or wrong ? (I think it's wrong):
Dim thSleep As New Thread(AddressOf AppSleep)
Sub AppSleep()
Do
Thread.Sleep(500)
Loop
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim sr As StreamReader = New StreamReader("d:\test.txt")
Dim s As String = ""
Do While sr.Peek() >= 0
s = sr.ReadLine()
Console.WriteLine(s)
If s.Substring(0, 1) = "{" Then
s = s.Substring(1, s.Length - 2)
Dim myArray() As String = Split(s, ",", ,
CompareMethod.Text)
ClickPosition()
AppSleep()
Else
TextInput = s
WriteText()
AppSleep()
End If
Loop
sr.Close()
sr.Dispose()
End Sub
The essense is that for each line either a mouse click og textline i
send to another application. For each click/text I wish for the
application to "absorb" it.
Regards /Snedker