Wednesday, May 29, 2013

Ping computer

The for statement is incorrect. The code below should work for you.



string[] bping = { "192.168.1.1", "192.168.1.2" };
for (int i = 0; i < bping.Length; i++)
{
Ping ping = new Ping();
PingReply pingReply = ping.Send(bping[i].ToString());
Console.WriteLine("Status: {0}", pingReply.Status + " " + pingReply.Address);
}
Console.ReadLine();


No comments:

Post a Comment