IPGlobalProperties.GetIcmpV4Statistics メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
ローカル コンピューターのインターネット コントロール メッセージ プロトコル (ICMP: Internet Control Message Protocol) Version 4 の統計データを提供します。
public:
abstract System::Net::NetworkInformation::IcmpV4Statistics ^ GetIcmpV4Statistics();
public abstract System.Net.NetworkInformation.IcmpV4Statistics GetIcmpV4Statistics ();
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
public abstract System.Net.NetworkInformation.IcmpV4Statistics GetIcmpV4Statistics ();
abstract member GetIcmpV4Statistics : unit -> System.Net.NetworkInformation.IcmpV4Statistics
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
abstract member GetIcmpV4Statistics : unit -> System.Net.NetworkInformation.IcmpV4Statistics
Public MustOverride Function GetIcmpV4Statistics () As IcmpV4Statistics
戻り値
ローカル コンピューターの ICMP version 4 トラフィック統計情報を提供する IcmpV4Statistics オブジェクト。
- 属性
例外
Win32 関数 GetIcmpStatistics
が失敗しました。
例
次の例では、現在の ICMPv4 統計情報を表示します。
void ShowIcmpV4Statistics()
{
IPGlobalProperties ^ properties = IPGlobalProperties::GetIPGlobalProperties();
IcmpV4Statistics ^ stat = properties->GetIcmpV4Statistics();
Console::WriteLine( "ICMP V4 Statistics:" );
Console::WriteLine( " Messages ............................ Sent: {0,-10} Received: {1,-10}", stat->MessagesSent, stat->MessagesReceived );
Console::WriteLine( " Errors .............................. Sent: {0,-10} Received: {1,-10}", stat->ErrorsSent, stat->ErrorsReceived );
Console::WriteLine( " Echo Requests ....................... Sent: {0,-10} Received: {1,-10}", stat->EchoRequestsSent, stat->EchoRequestsReceived );
Console::WriteLine( " Echo Replies ........................ Sent: {0,-10} Received: {1,-10}", stat->EchoRepliesSent, stat->EchoRepliesReceived );
Console::WriteLine( " Destination Unreachables ............ Sent: {0,-10} Received: {1,-10}", stat->DestinationUnreachableMessagesSent, stat->DestinationUnreachableMessagesReceived );
Console::WriteLine( " Source Quenches ..................... Sent: {0,-10} Received: {1,-10}", stat->SourceQuenchesSent, stat->SourceQuenchesReceived );
Console::WriteLine( " Redirects ........................... Sent: {0,-10} Received: {1,-10}", stat->RedirectsSent, stat->RedirectsReceived );
Console::WriteLine( " TimeExceeded ........................ Sent: {0,-10} Received: {1,-10}", stat->TimeExceededMessagesSent, stat->TimeExceededMessagesReceived );
Console::WriteLine( " Parameter Problems .................. Sent: {0,-10} Received: {1,-10}", stat->ParameterProblemsSent, stat->ParameterProblemsReceived );
Console::WriteLine( " Timestamp Requests .................. Sent: {0,-10} Received: {1,-10}", stat->TimestampRequestsSent, stat->TimestampRequestsReceived );
Console::WriteLine( " Timestamp Replies ................... Sent: {0,-10} Received: {1,-10}", stat->TimestampRepliesSent, stat->TimestampRepliesReceived );
Console::WriteLine( " Address Mask Requests ............... Sent: {0,-10} Received: {1,-10}", stat->AddressMaskRequestsSent, stat->AddressMaskRequestsReceived );
Console::WriteLine( " Address Mask Replies ................ Sent: {0,-10} Received: {1,-10}", stat->AddressMaskRepliesSent, stat->AddressMaskRepliesReceived );
Console::WriteLine( "" );
}
public static void ShowIcmpV4Statistics()
{
IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
IcmpV4Statistics stat = properties.GetIcmpV4Statistics();
Console.WriteLine("ICMP V4 Statistics:");
Console.WriteLine(" Messages ............................ Sent: {0,-10} Received: {1,-10}",
stat.MessagesSent, stat.MessagesReceived);
Console.WriteLine(" Errors .............................. Sent: {0,-10} Received: {1,-10}",
stat.ErrorsSent, stat.ErrorsReceived);
Console.WriteLine(" Echo Requests ....................... Sent: {0,-10} Received: {1,-10}",
stat.EchoRequestsSent, stat.EchoRequestsReceived);
Console.WriteLine(" Echo Replies ........................ Sent: {0,-10} Received: {1,-10}",
stat.EchoRepliesSent, stat.EchoRepliesReceived);
Console.WriteLine(" Destination Unreachables ............ Sent: {0,-10} Received: {1,-10}",
stat.DestinationUnreachableMessagesSent, stat.DestinationUnreachableMessagesReceived);
Console.WriteLine(" Source Quenches ..................... Sent: {0,-10} Received: {1,-10}",
stat.SourceQuenchesSent, stat.SourceQuenchesReceived);
Console.WriteLine(" Redirects ........................... Sent: {0,-10} Received: {1,-10}",
stat.RedirectsSent, stat.RedirectsReceived);
Console.WriteLine(" TimeExceeded ........................ Sent: {0,-10} Received: {1,-10}",
stat.TimeExceededMessagesSent, stat.TimeExceededMessagesReceived);
Console.WriteLine(" Parameter Problems .................. Sent: {0,-10} Received: {1,-10}",
stat.ParameterProblemsSent, stat.ParameterProblemsReceived);
Console.WriteLine(" Timestamp Requests .................. Sent: {0,-10} Received: {1,-10}",
stat.TimestampRequestsSent, stat.TimestampRequestsReceived);
Console.WriteLine(" Timestamp Replies ................... Sent: {0,-10} Received: {1,-10}",
stat.TimestampRepliesSent, stat.TimestampRepliesReceived);
Console.WriteLine(" Address Mask Requests ............... Sent: {0,-10} Received: {1,-10}",
stat.AddressMaskRequestsSent, stat.AddressMaskRequestsReceived);
Console.WriteLine(" Address Mask Replies ................ Sent: {0,-10} Received: {1,-10}",
stat.AddressMaskRepliesSent, stat.AddressMaskRepliesReceived);
Console.WriteLine("");
}
注釈
ICMP は、インターネット プロトコル バージョン 4 (IPv4) で使用するメッセージのセットです。 ICMP は、データ パケットの処理中に発生したエラーを報告したり、他のインターネット層機能を実行したりするために、IPv4 ノードによって使用されます。 ICMP バージョン 4 は IETF RFC 792 で定義されています。
アプリケーションで使用できる ICMP バージョン 4 のトラフィック統計の詳細については、クラスのドキュメントを IcmpV4Statistics 参照してください。 IcmpV4Statisticsこのメソッドによって返されるオブジェクトには、オブジェクトが作成された時点の統計が反映されることに注意してください。 この情報は動的に更新されません。
適用対象
.NET