public partial class Form1 : Form{ public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { string remoteMachineNameOrIP= "192.1.168.1"; int timeOut = 5; Ping ping = new Ping(); // Pinging remote maching PingReply reply = ping.Send(remoteMachineNameOrIP, timeOut); // Displaying the result StringBuilder sb = new StringBuilder(); sb.Append("Address:" + reply.Address.ToString()); sb.Append("\nStatus:" + reply.Status.ToString()); sb.Append("\nRoundtripTime:" + reply.RoundtripTime.ToString()); MessageBox.Show(sb.ToString(), "Ping Result: " + remoteMachineNameOrIP); }}