示例#1
0
 bool CurrentPingStatus()
 {
     for (int i = 0; i < 5; i++)
     {
         Ping ping = new Ping(GetCurrentServerInfo().IP);
         if (!ping.IsSuccess())
         {
             MessageBox.Show("服务器Ping失败,请检查网络");
             return(false);
         }
         else
         {
             m_sleeptime += ping.GetRoundTime();
         }
     }
     m_sleeptime = m_sleeptime / 5 + 10;
     return(true);
 }