IPAddress.ScopeId Proprietà
Definizione
Ottiene o imposta l'identificatore di ambito dell'indirizzo IPv6.Gets or sets the IPv6 address scope identifier.
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
Valore della proprietà
Valore long integer che specifica l’ambito dell'indirizzo.A long integer that specifies the scope of the address.
Eccezioni
AddressFamily
= InterNetwork
.AddressFamily
= InterNetwork
.
scopeId
< 0scopeId
< 0
-oppure--or-
scopeId
> 0x00000000FFFFFFFFscopeId
> 0x00000000FFFFFFFF
Esempio
// 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
Commenti
Il significato delle ScopeId modifiche varia a seconda del contesto in cui viene usato.The meaning of ScopeId changes depending on the context in which it is used.
- Indirizzo locale del collegamento.Link-local address. In un host con più interfacce connesse a collegamenti distinti, è possibile assegnare lo stesso indirizzo locale del collegamento a più interfacce.On a host with multiple interfaces connected to separate links, the same link-local address can be assigned to multiple interfaces. Per eliminare questa ambiguità, viene usato un identificatore di ambito per specificare l'interfaccia su cui vengono scambiati i messaggi.To eliminate this ambiguity, a scope identifier is used to specify the interface over which messages are exchanged.
Nota
Gli indirizzi locali rispetto al collegamento, identificati dal prefisso di formato (FP) FE80, vengono utilizzati dai nodi durante la comunicazione con nodi adiacenti sullo stesso collegamento.Link-local addresses, identified by the Format Prefix (FP) FE80, are used by nodes when communicating with neighboring nodes on the same link.
- Indirizzi locali rispetto al sito.Site-local addresses. Un host può essere connesso a più siti.A host can be connected to multiple sites. In questo caso, viene usato un identificatore di ambito per indicare un sito specifico con cui comunicare.In this case, a scope identifier is used to indicate a specific site to communicate with.
Nota
Gli indirizzi locali del sito, identificati dal prefisso di formato (FP) FEC0, vengono usati dai nodi durante la comunicazione su reti Intranet private.Site-local addresses, identified by the Format Prefix (FP) FEC0, are used by nodes when communicating on private intranets.
La notazione utilizzata per specificare l'oggetto ScopeId
con un indirizzo è Address%ScopeId
.The notation that is used to specify the ScopeId
with an address is Address%ScopeId
. Ad esempio, FE80::5EFE:192.168.41.30%2.
.For example, FE80::5EFE:192.168.41.30%2.