private void PingSIM() { IPAddress ip = null; IPEndPoint simip = client.Network.CurrentSim.IPEndPoint; BeginInvoke(new MethodInvoker(delegate() { label10.Text = "SIM: " + client.Network.CurrentSim.Name + " (" + client.Network.CurrentSim.IPEndPoint.ToString() + ")"; })); ip = simip.Address; PingHost ping = new PingHost(); ping.Change += new PingHost.PingResponsereceived(ping_ChangeTimer); ping.StartPing(ip); }
private void button3_Click(object sender, EventArgs e) { rtBox1.Clear(); IPAddress ip = null; try { ip = Dns.GetHostEntry(textBox1.Text).AddressList[0]; } catch (System.Net.Sockets.SocketException ex) { rtBox1.Text += "DNS Error: " + ex.Message; return; } rtBox1.Text += "Pinging " + textBox1.Text + " [" + ip.ToString() + "] with 32 bytes of data:\n"; PingHost ping = new PingHost(); ping.Change += new PingHost.PingResponsereceived(ping_Change); ping.StartPing(ip); }