共用方式為


IcmpV4Statistics 類別

定義

提供本機電腦之 IPv4 的網際網路控制訊息通訊協定 (ICMPv4) 統計資料。

public ref class IcmpV4Statistics abstract
public abstract class IcmpV4Statistics
type IcmpV4Statistics = class
Public MustInherit Class IcmpV4Statistics
繼承
IcmpV4Statistics

範例

下列範例會顯示目前的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("");
}

備註

ICMPv4 是一組錯誤和參考訊息,可與因特網通訊協定第 4 版搭配使用。 ICMP 第 4 版定義於 IETF RFC 792 中。

這個類別是由 GetIcmpV4Statistics 方法用來傳回ICMPv4流量資訊。

建構函式

IcmpV4Statistics()

初始化 IcmpV4Statistics 類別的新執行個體。

屬性

AddressMaskRepliesReceived

取得已收到的網際網路控制訊息通訊協定第 4 版 (ICMPv4)「位址遮罩回覆」訊息數目。

AddressMaskRepliesSent

取得已傳送的網際網路控制訊息通訊協定第 4 版 (ICMPv4)「位址遮罩回覆」訊息數目。

AddressMaskRequestsReceived

取得已收到的網際網路控制訊息通訊協定第 4 版 (ICMPv4)「位址遮罩要求」訊息數目。

AddressMaskRequestsSent

取得已傳送的網際網路控制訊息通訊協定第 4 版 (ICMPv4)「位址遮罩要求」訊息數目。

DestinationUnreachableMessagesReceived

取得由於封包有無法到達的目的位址而收到的網際網路控制訊息通訊協定第 4 版 (ICMPv4) 訊息數目。

DestinationUnreachableMessagesSent

取得由於封包有無法到達的目的位址而傳送的網際網路控制訊息通訊協定第 4 版 (ICMPv4) 訊息數目。

EchoRepliesReceived

取得已收到的網際網路控制訊息通訊協定第 4 版 (ICMPv4)「回應回覆」訊息數目。

EchoRepliesSent

取得已傳送的網際網路控制訊息通訊協定第 4 版 (ICMPv4)「回應回覆」訊息數目。

EchoRequestsReceived

取得已收到的網際網路控制訊息通訊協定第 4 版 (ICMPv4)「回應要求」訊息數目。

EchoRequestsSent

取得已傳送的網際網路控制訊息通訊協定第 4 版 (ICMPv4)「回應要求」訊息數目。

ErrorsReceived

取得已收到的網際網路控制訊息通訊協定第 4 版 (ICMPv4) 錯誤訊息數目。

ErrorsSent

取得已傳送的網際網路控制訊息通訊協定第 4 版 (ICMPv4) 錯誤訊息數目。

MessagesReceived

取得已收到的網際網路控制訊息通訊協定訊息數目。

MessagesSent

取得已傳送的網際網路控制訊息通訊協定第 4 版 (ICMPv4) 訊息數目。

ParameterProblemsReceived

取得已收到的網際網路控制訊息通訊協定第 4 版 (ICMPv4)「參數問題」訊息數目。

ParameterProblemsSent

取得已傳送的網際網路控制訊息通訊協定第 4 版 (ICMPv4)「參數問題」訊息數目。

RedirectsReceived

取得已收到的網際網路控制訊息通訊協定第 4 版 (ICMPv4)「重新導向」訊息數目。

RedirectsSent

取得已傳送的網際網路控制訊息通訊協定第 4 版 (ICMPv4)「重新導向」訊息數目。

SourceQuenchesReceived

取得已收到的網際網路控制訊息通訊協定第 4 版 (ICMPv4)「來源抑制」訊息數目。

SourceQuenchesSent

取得已傳送的網際網路控制訊息通訊協定第 4 版 (ICMPv4)「來源抑制」訊息數目。

TimeExceededMessagesReceived

取得已收到的網際網路控制訊息通訊協定第 4 版 (ICMPv4)「超過時間」訊息數目。

TimeExceededMessagesSent

取得已傳送的網際網路控制訊息通訊協定第 4 版 (ICMPv4)「超過時間」訊息數目。

TimestampRepliesReceived

取得已收到的網際網路控制訊息通訊協定第 4 版 (ICMPv4)「時間戳記回覆」訊息數目。

TimestampRepliesSent

取得已傳送的網際網路控制訊息通訊協定第 4 版 (ICMPv4)「時間戳記回覆」訊息數目。

TimestampRequestsReceived

取得已收到的網際網路控制訊息通訊協定第 4 版 (ICMPv4)「時間戳記要求」訊息數目。

TimestampRequestsSent

取得已傳送的網際網路控制訊息通訊協定第 4 版 (ICMPv4)「時間戳記要求」訊息數目。

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於