Private Sub DoThreadedPing() Dim client As New WebClient Dim strm As Stream Dim sr As StreamReader Dim pingTXT As String Try strm = client.OpenRead(New Uri(Ping1Info)) sr = New StreamReader(strm) Do pingTXT = sr.ReadLine If pingTXT IsNot Nothing Then TextBox1.Invoke(New PingDelegate(AddressOf WritePing), pingTXT) Loop While pingTXT IsNot Nothing Catch ex As Exception ... Finally ... End Sub
BackgroundWorker
BackgroundWorker.CancelAsync()
strm.BeginRead
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)