共用方式為


IcmpV6Statistics.RouterSolicitsReceived 屬性

定義

取得已收到的網際網路控制訊息通訊協定第 6 版 (ICMPv6)「路由器請求」訊息數目。

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

屬性值

Int64 值,指定已收到的「路由器請求」訊息總數。

範例

下列範例會顯示這個屬性的值。

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數據報傳送到其直接連接的子網之外。 此探索可以使用稱為路由器公告和路由器請求的ICMP訊息來完成。 路由器會定期傳送公告訊息,以宣告其存在及其介面的位址。 當計算機連線到網路,而不是等候接收路由器公告時,它可以傳送路由器請求,要求路由器立即傳送廣告。

適用於