目标:获取服务器的外部IP地址列表.执行ping以测试延迟.与CMD类似,ping命令显示平均延迟.但是在visual studio中我发现ping只作为连接到服务器的布尔值.我如何测试服务器的延迟以找到vb.n
Skill Lvl:接近绝对的初学者
这里有一个VB.NET的ping示例Dim host As String = "82.123.23.XX" ' use any other machine name Dim pingreq As Ping = New Ping() Dim rep As PingReply = pingreq.Send(host ) Console.WriteLine("Pinging {0} [{1}]", host , rep.Address.ToString()) Console.WriteLine("Reply From {0} : time={1} TTL={2}", rep.Address.ToString(), rep.RoundtripTime, rep.Options.Ttl)
您需要导入
System.Net.NetworkInformation