IcmpV6Statistics.RouterSolicitsSent 屬性

定義

取得已傳送的網際網路控制訊息通訊協定第 6 版 (ICMPv6)「路由器請求」訊息數目。Gets the number of Internet Control Message Protocol version 6 (ICMPv6) Router Solicitation messages sent.

public:
 abstract property long RouterSolicitsSent { long get(); };
public abstract long RouterSolicitsSent { get; }
member this.RouterSolicitsSent : int64
Public MustOverride ReadOnly Property RouterSolicitsSent As Long

屬性值

Int64

Int64 值,指定已傳送的「路由器請求」訊息總數。An Int64 value that specifies the total number of Router Solicitation messages sent.

範例

下列範例會顯示這個屬性的值。The following example displays the value of this property.

void ShowIcmpV6RouterData()
{
   IPGlobalProperties ^ properties = IPGlobalProperties::GetIPGlobalProperties();
   IcmpV6Statistics ^ statistics = properties->GetIcmpV6Statistics();
   Console::WriteLine( "  Advertisements ....................... Sent: {0,-10}   Received: {1,-10}", 
      statistics->RouterAdvertisementsSent, 
      statistics->RouterAdvertisementsReceived );
   Console::WriteLine( "  Solicits ............................. Sent: {0,-10}   Received: {1,-10}", 
      statistics->RouterSolicitsSent, 
      statistics->RouterSolicitsReceived );
}
public static void ShowIcmpV6RouterData ()
{
    IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
    IcmpV6Statistics statistics = properties.GetIcmpV6Statistics();

    Console.WriteLine ("  Advertisements ....................... Sent: {0,-10}   Received: {1,-10}",
        statistics.RouterAdvertisementsSent, statistics.RouterAdvertisementsReceived);
    Console.WriteLine ("  Solicits ............................. Sent: {0,-10}   Received: {1,-10}",
        statistics.RouterSolicitsSent, statistics.RouterSolicitsReceived);
}

Public Shared Sub ShowIcmpV6RouterData() 
    Dim properties As IPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties()
    Dim statistics As IcmpV6Statistics = properties.GetIcmpV6Statistics()
    
    Console.WriteLine("  Advertisements ....................... Sent: {0,-10}   Received: {1,-10}", statistics.RouterAdvertisementsSent, statistics.RouterAdvertisementsReceived)
    Console.WriteLine("  Solicits ............................. Sent: {0,-10}   Received: {1,-10}", statistics.RouterSolicitsSent, statistics.RouterSolicitsReceived)

End Sub


備註

在主機電腦將 IP 資料包傳送到其直接附加的子網之前,它必須探索該子網上至少有一個路由器的位址。Before a host computer can send IP datagrams beyond its directly attached subnet, it must discover the address of at least one router on that subnet. 這項探索可以使用名為路由器通告和路由器請求的 ICMP 訊息來完成。This discovery can be accomplished using ICMP messages called Router Advertisements and Router Solicitations. 路由器會定期傳送公告訊息,以宣告其目前狀態和其介面的位址。An Advertisement message is sent by a router periodically to announce its presence and the addresses of its interfaces. 當電腦連線到網路,而不是等待接收路由器通告時,它可以傳送路由器請求,要求路由器立即傳送公告。When a computer connects to a network, rather than waiting to receive Router Advertisements, it can send Router Solicitations to request that routers send their advertisements immediately.

適用於