private void button1_Click(object sender, EventArgs e) { Ping ping = new Ping(); PingReply pingresult1 = ping.Send("8.8.8.8"); if (pingresult1.Status.ToString() == "Success") { lblPing.BackColor= Color.Green; } else { lblPing.BackColor = Color.Red; } PingReply pingresult2 = ping.Send("5.5.5.5"); if (pingresult2.Status.ToString() == "Success") { label1.BackColor = Color.Green; } else { label1.BackColor = Color.Red; } }
System.Windows.Forms
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)