Private Sub Command3_Click()
Timer1.Enabled = True
Label2.Caption = "Checking..."
Option1.Enabled = False
Option2.Enabled = False
Option3.Enabled = False
Text1.Enabled = False
WebBrowser1.Navigate (Text1.Text)
End Sub
Private Function WebPageContains(ByVal s As String) As Boolean
Dim i As Long, EHTML
Dim strfindword As String
For i = 1 To WebBrowser1.Document.All.length
Set EHTML = WebBrowser1.Document.All.Item(i)
If Not (EHTML Is Nothing) Then
If InStr(1, EHTML.innerHTML, s, vbTextCompare) > 0 Then
WebPageContains = True
strfindword = EHTML.innerHTML
Text2.Text = strfindword
MsgBox "prout"
Exit Function
End If
End If
Next i
End Function
Private Sub Timer1_Timer()
If WebPageContains("Channel (Online)") Then
Image1.Picture = LoadResPicture(101, vbResBitmap)
Label2.Caption = "Online"
Form1.Caption = "Retector: Stream Online"
Form1.Show
Else
Image1.Picture = LoadResPicture(102, vbResBitmap)
Label2.Caption = "Offline"
Form1.Caption = "Retector: Offline"
Label3.Caption = "Checking..."
End If
WebBrowser1.Navigate (Text1.Text) & Timer
End Sub