Bagikan melalui


IPAddress.ScopeId Properti

Definisi

Mendapatkan atau mengatur pengidentifikasi cakupan alamat IPv6.

public:
 property long ScopeId { long get(); void set(long value); };
public long ScopeId { get; set; }
member this.ScopeId : int64 with get, set
Public Property ScopeId As Long

Nilai Properti

Bilangan bulat panjang yang menentukan cakupan alamat.

Pengecualian

AddressFamily = InterNetwork.

scopeId< 0

-atau-

scopeId> 0x00000000FFFFFFFF

Contoh

// Display the type of address family supported by the server. If the
// server is IPv6-enabled this value is: InterNetworkV6. If the server
// is also IPv4-enabled there will be an additional value of InterNetwork.
Console::WriteLine( "AddressFamily: {0}", curAdd->AddressFamily );

// Display the ScopeId property in case of IPV6 addresses.
if ( curAdd->AddressFamily.ToString() == ProtocolFamily::InterNetworkV6.ToString() )
         Console::WriteLine( "Scope Id: {0}", curAdd->ScopeId );

// Display the type of address family supported by the server. If the
// server is IPv6-enabled this value is: InterNetworkV6. 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: InterNetworkV6. 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

Keterangan

Arti perubahan ScopeId tergantung pada konteks penggunaannya.

  • Alamat lokal tautan. Pada host dengan beberapa antarmuka yang terhubung ke tautan terpisah, alamat lokal tautan yang sama dapat ditetapkan ke beberapa antarmuka. Untuk menghilangkan ambiguitas ini, pengidentifikasi cakupan digunakan untuk menentukan antarmuka tempat pesan ditukar.

Catatan

Alamat lokal tautan, yang diidentifikasi oleh Awalan Format (FP) FE80, digunakan oleh simpul saat berkomunikasi dengan simpul tetangga pada tautan yang sama.

  • Alamat situs-lokal. Host dapat disambungkan ke beberapa situs. Dalam hal ini, pengidentifikasi cakupan digunakan untuk menunjukkan situs tertentu untuk berkomunikasi.

Catatan

Alamat lokal situs, yang diidentifikasi oleh Awalan Format (FP) FEC0, digunakan oleh simpul saat berkomunikasi pada intranet privat.

Notasi yang digunakan untuk menentukan ScopeId dengan alamat adalah Address%ScopeId. Misalnya, FE80::5EFE:192.168.41.30%2.

Berlaku untuk