PingCompletedEventArgs.Reply プロパティ
アセンブリ: System (system.dll 内)

ICMP エコー要求の結果を記述した PingReply オブジェクト。

Status の値が Success でない場合は、RoundTripTime、Options、および Buffer の各プロパティによって返される値は使用しないでください。RoundTripTime プロパティおよび Buffer プロパティは 0 を返し、Options プロパティは null 参照 (Visual Basic では Nothing) を返します。

PingCompleted イベントへの応答に使用するメソッドを実装したコード例を次に示します。詳細については、PingCompletedEventArgs クラスの概要を参照してください。
public static void PingCompletedCallback (object sender, PingCompletedEventArgs e) { // If the operation was canceled, display a message to the user. if (e.Cancelled) { Console.WriteLine ("Ping canceled."); // Let the main thread resume. // UserToken is the AutoResetEvent object that the main thread // is waiting for. ((AutoResetEvent)e.UserState).Set (); } // If an error occurred, display the exception to the user. if (e.Error != null) { Console.WriteLine ("Ping failed:"); Console.WriteLine (e.Error.ToString ()); // Let the main thread resume. ((AutoResetEvent)e.UserState).Set(); } PingReply reply = e.Reply; DisplayReply (reply); // Let the main thread resume. ((AutoResetEvent)e.UserState).Set(); }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- PingCompletedEventArgs.Reply プロパティのページへのリンク