1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
Timer1.Enabled = False
Try
Const URLString As String = "http://relayboard/status.xml"
Dim reader As XmlTextReader = New XmlTextReader(URLString)
If reader IsNot Nothing Then
Do While (reader.Read())
' Traiter les données ici.
If reader.Name = ("led0") Then
reader.Read()
Label1.BackColor = If(reader.Value = 1, Color.Green, Color.Red)
ElseIf reader.Name = ("led1") Then
reader.Read()
Label2.BackColor = If(reader.Value = 1, Color.Green, Color.Red)
ElseIf reader.Name = ("led2") Then
reader.Read()
Label3.BackColor = If(reader.Value = 1, Color.Green, Color.Red)
ElseIf reader.Name = ("led3") Then
reader.Read()
Label5.BackColor = If(reader.Value = 1, Color.Green, Color.Red)
ElseIf reader.Name = ("led4") Then
reader.Read()
Label6.BackColor = If(reader.Value = 1, Color.Green, Color.Red)
ElseIf reader.Name = ("led5") Then
reader.Read()
Label7.BackColor = If(reader.Value = 1, Color.Green, Color.Red)
ElseIf reader.Name = ("led6") Then
reader.Read()
Label8.BackColor = If(reader.Value = 1, Color.Green, Color.Red)
ElseIf reader.Name = ("led7") Then
reader.Read()
Label9.BackColor = If(reader.Value = 1, Color.Green, Color.Red)
End If
Loop
End If
Catch ex As Exception
End Try
'Timer1.Enabled = True |
Partager