ok so i am really sorry if this has been answered before i am not the best at at VB.net by far anyways i have a problem, i have written some code in a VB i have made that pings a server and give me and MS and writes it on the app, now what i need is it to be able to ping the port in the same equation but i am not sure how and if i can even implement it into my code, the reason behind this is that it pings a game server, so when the servers are not up they close a port,
anyways i will put some code here and see if you guys think i can implement it if not any pointers will be greatly appreciated
anyways i will put some code here and see if you guys think i can implement it if not any pointers will be greatly appreciated
Code:
If InternetConnection() = True Then
Dim p As System.Net.NetworkInformation.Ping = New System.Net.NetworkInformation.Ping
Dim prep As System.Net.NetworkInformation.PingReply
'if server = 0 then ping server and
If (server = 0) Then
Dim url As String = "79.110.94.195"
prep = p.Send(url)
If (prep.Status = System.Net.NetworkInformation.IPStatus.Success) Then
Dim address As String = prep.Address.ToString
Dim time As String = prep.RoundtripTime.ToString
Label3.Text = (time + " Ms")
server_pic.Image = Image.FromFile("config\server_up.png")
Else
Dim status As String = prep.Status.ToString
server_pic.Image = Image.FromFile("config\server_down.png")
Label3.Text = ("0 Ms")
End If