✔ 最佳答案
The problem is that “ping” will block and wait for server respond by using ICMP Protocol. If the server does not respond, ping will wait until timeout, the wait time can be as long as a few minutes for each check.
If you are using Send try “SendAsync”. Each SendAsync will create a thread on its own, so your program does not need to wait for rely from each site one by one!!
From MSDN
The Ping class offers both synchronous and asynchronous methods for sending the request. If your application should block while waiting for a reply, use the Send methods; these methods are synchronous. If your application should not block,use the asynchronous SendAsync methods. A call to SendAsync executes in its own thread that is automatically allocated from the threadpool. When the asynchronous operation completes, it raises the PingCompleted event. Applications use a PingCompletedEventHandler delegate to specify the method that is called for PingCompleted events. You must add a PingCompletedEventHandler delegate to the event before calling SendAsync.The delegate's method receives a PingCompletedEventArgs object that contains a PingReply object that describes the result of the SendAsync call.
You cannot use the same instance of the Ping class to generate multiple simultaneous ICMP Echo requests. Calling Sendwhile a SendAsync call is in progress or calling SendAsync multiple times before all previous calls have completed causes an InvalidOperationException.