hapkidoin
New member
I have code that does a network ping, as well. This is a tool that one of our guys can use to see if a server is up and if it is experiencing any up/down/up issues. If someone would look at this and tell me what they think, I would really appreciate it. I don't do this particular task very often.
I would appreciate the feedback. I have been a programmer for a long time, but I am self-taught as my company had no budget to train me. I've always found a way to do what I needed to do, but I do not know if this is a good (or bad or anything else) way to do it.
Thanks!
VB.NET:
Try
Dim output As System.Net.NetworkInformation.PingReply
Dim pinger As New System.Net.NetworkInformation.Ping
output = pinger.Send(TextBox1.Text)
RichTextBox1.Text += Now.ToString & " - " & output.Status.ToString & Chr(10)
NumberOfSuccessfulPings += 1
Label1.Text = "Success: " & NumberOfSuccessfulPings
Catch ex As Exception
NumberOfFailedPings += 1
Label2.Text = "Fail: " & NumberOfFailedPings
RichTextBox1.Text += ex.Message.ToString
End Try
I would appreciate the feedback. I have been a programmer for a long time, but I am self-taught as my company had no budget to train me. I've always found a way to do what I needed to do, but I do not know if this is a good (or bad or anything else) way to do it.
Thanks!