I am currently making a server monitoring application that pings the server to check its uplink, so far it creates all the picture boxes and labels for each server, and then pings the server, although I have a picture that I want to change dependant on the result.
Below is the code I am currently using, the problem occurs with the objectname variable which allows dynamic coding, where i get a error, saying that "Public member 'image' on type 'String' not found".
Private Sub Ping() Dim i As Integer Dim objectName As System.Object For i = 1 To count - 1 Dim pingSender = New Ping() 'Send the packet with a 1500ms timeout Dim reply As PingReply = pingSender.Send(servers(2, i), 1500) 'Output the reply in the appropriate colour depending on RoundtripTime objectName = "pic" + servers(1, i) If reply.Status = IPStatus.Success Then If (reply.RoundtripTime <= 200) Then objectName. = My.Resources.Online ElseIf (reply.RoundtripTime > 200 & reply.RoundtripTime <= 600) Then objectName.Image = My.Resources.Problem End If Else objectName.Image = My.Resources.Offline End If Next End Sub
Can anyone see where I have gone wrong?
Thanks in Advance