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

アドレスのスコープを指定する長整数。


ScopeId の意味は、それが使用されているコンテキストによって異なります。
-
リンクローカル アドレスの場合。異なるリンクに接続している複数のインターフェイスを持つホストで、同じリンクローカル アドレスを複数のインターフェイスに割り当てることができます。このあいまいさを避けるために、スコープ識別子を使用して、メッセージの交換に使用するインターフェイスを指定します。
![]() |
---|
Format Prefix (FP) FE80 によって識別されるリンクローカル アドレスは、同じリンク上の近隣のノードと通信するときにノードによって使用されます。 |
ScopeId とアドレスを指定するときに使用する表記は Address%ScopeId です。たとえば、FE80::5EFE:192.168.41.30%2. です。

' Display the type of address family supported by the server. If the ' server is IPv6-enabled this value is: InternNetworkV6. If the server ' is also IPv4-enabled there will be an additional value of InterNetwork. Console.WriteLine(("AddressFamily: " + curAdd.AddressFamily.ToString())) ' Display the ScopeId property in case of IPV6 addresses. If curAdd.AddressFamily.ToString() = ProtocolFamily.InterNetworkV6.ToString() Then Console.WriteLine(("Scope Id: " + curAdd.ScopeId.ToString())) End If
// Display the type of address family supported by the server. If the // server is IPv6-enabled this value is: InternNetworkV6. If the server // is also IPv4-enabled there will be an additional value of InterNetwork. Console.WriteLine("AddressFamily: " + curAdd.AddressFamily.ToString()); // Display the ScopeId property in case of IPV6 addresses. if(curAdd.AddressFamily.ToString() == ProtocolFamily.InterNetworkV6.ToString()) Console.WriteLine("Scope Id: " + curAdd.ScopeId.ToString());
// Display the type of address family supported by the server. // If the server is IPv6-enabled this value is:InternNetworkV6. // If the server is also IPv4-enabled there will be an // additional value of InterNetwork. Console.WriteLine(("AddressFamily: " + curAdd.get_AddressFamily().ToString())); // Display the ScopeId property in case of IPV6 addresses. if (curAdd.get_AddressFamily().ToString().equals( ProtocolFamily.InterNetworkV6.ToString())) { Console.WriteLine(("Scope Id: " +(new Long(curAdd.get_ScopeId())).ToString())); }

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


- IPAddress.ScopeId プロパティのページへのリンク