void Tester_OnResult(object sender, PingResultEventArgs e) { PingTester tester = (PingTester)sender; WriteLog("回應狀態 : {0}", e.Status); WriteLog("對象主機IP : {0}", e.RemoteIP); WriteLog("回應時間 {0} 豪秒", e.RoundtripTime); WriteLog("轉送次數 : {0}", tester.TimeToLive - e.Ttl); WriteLog("============================"); }
void Tester_OnException(object sender, PingResultEventArgs e) { WriteLog("錯誤發生 : {0}", e.Exception.Message); WriteLog("============================"); }