IPAddress Costruttori
Definizione
Overload
IPAddress(Byte[]) |
Inizializza una nuova istanza della classe IPAddress con l'indirizzo specificato come matrice Byte.Initializes a new instance of the IPAddress class with the address specified as a Byte array. |
IPAddress(Int64) |
Inizializza una nuova istanza della classe IPAddress con l'indirizzo specificato struttura Int64.Initializes a new instance of the IPAddress class with the address specified as an Int64. |
IPAddress(ReadOnlySpan<Byte>) |
Inizializza una nuova istanza della classe IPAddress con l'indirizzo specificato come intervallo di byte.Initializes a new instance of the IPAddress class with the address specified as a byte span. |
IPAddress(Byte[], Int64) |
Inizializza una nuova istanza della classe IPAddress con l'indirizzo specificato come matrice Byte e l'identificatore di ambito specificato.Initializes a new instance of the IPAddress class with the address specified as a Byte array and the specified scope identifier. |
IPAddress(ReadOnlySpan<Byte>, Int64) |
Inizializza una nuova istanza della classe IPAddress con l'indirizzo specificato come intervallo di byte e l'identificatore di ambito specificato.Initializes a new instance of the IPAddress class with the address specified as a byte span and the specified scope identifier. |
IPAddress(Byte[])
public:
IPAddress(cli::array <System::Byte> ^ address);
public IPAddress (byte[] address);
new System.Net.IPAddress : byte[] -> System.Net.IPAddress
Public Sub New (address As Byte())
Parametri
- address
- Byte[]
Valore della matrice di byte dell'indirizzo IP.The byte array value of the IP address.
Eccezioni
address
è null
.address
is null
.
address
contiene un indirizzo IP errato.address
contains a bad IP address.
Commenti
IPAddressViene creato con la Address proprietà impostata su address
.The IPAddress is created with the Address property set to address
.
Se la lunghezza di address
è 4, IPAddress(Byte[]) costruisce un indirizzo IPv4. in caso contrario, viene costruito un indirizzo IPv6 con ambito 0.If the length of address
is 4, IPAddress(Byte[]) constructs an IPv4 address; otherwise, an IPv6 address with a scope of 0 is constructed.
ByteSi presuppone che la matrice sia nell'ordine dei byte di rete con il byte più significativo per primo nella posizione di indice 0.The Byte array is assumed to be in network byte order with the most significant byte first in index position 0.
Si applica a
IPAddress(Int64)
public:
IPAddress(long newAddress);
public IPAddress (long newAddress);
new System.Net.IPAddress : int64 -> System.Net.IPAddress
Public Sub New (newAddress As Long)
Parametri
- newAddress
- Int64
Valore long dell'indirizzo IP.The long value of the IP address. Ad esempio, il valore 0x2414188f in formato big-endian corrisponde all'indirizzo IP "143.24.20.36".For example, the value 0x2414188f in big-endian format would be the IP address "143.24.20.36".
Eccezioni
newAddress
< 0 onewAddress
< 0 or
newAddress
> 0x00000000FFFFFFFFnewAddress
> 0x00000000FFFFFFFF
Commenti
L' IPAddress istanza viene creata con la Address proprietà impostata su newAddress
.The IPAddress instance is created with the Address property set to newAddress
.
Int64Si presuppone che il valore sia nell'ordine dei byte di rete.The Int64 value is assumed to be in network byte order.
Si applica a
IPAddress(ReadOnlySpan<Byte>)
public:
IPAddress(ReadOnlySpan<System::Byte> address);
public IPAddress (ReadOnlySpan<byte> address);
new System.Net.IPAddress : ReadOnlySpan<byte> -> System.Net.IPAddress
Public Sub New (address As ReadOnlySpan(Of Byte))
Parametri
- address
- ReadOnlySpan<Byte>
Rappresentazione in byte dell'indirizzo IP, nell'ordine dei byte di rete, con il byte più significativo per primo nella posizione di indice 0.The byte representation of the IP address, in network byte order, with the most significant byte first in index position 0.
Eccezioni
address
contiene un indirizzo IP errato.address
contains a bad IP address.
Commenti
IPAddressViene creato con la Address proprietà impostata su address
.The IPAddress is created with the Address property set to address
.
Se la lunghezza di address
è 4, questo metodo costruisce un indirizzo IPv4. in caso contrario, viene costruito un indirizzo IPv6 con ambito 0.If the length of address
is 4, this method constructs an IPv4 address; otherwise, an IPv6 address with a scope of 0 is constructed.
Si applica a
IPAddress(Byte[], Int64)
public:
IPAddress(cli::array <System::Byte> ^ address, long scopeid);
public IPAddress (byte[] address, long scopeid);
new System.Net.IPAddress : byte[] * int64 -> System.Net.IPAddress
Public Sub New (address As Byte(), scopeid As Long)
Parametri
- address
- Byte[]
Valore della matrice di byte dell'indirizzo IP.The byte array value of the IP address.
- scopeid
- Int64
Valore long dell'identificatore di ambito.The long value of the scope identifier.
Eccezioni
address
è null
.address
is null
.
address
contiene un indirizzo IP errato.address
contains a bad IP address.
scopeid
< 0 oscopeid
< 0 or
scopeid
> 0x00000000FFFFFFFFscopeid
> 0x00000000FFFFFFFF
Commenti
Questo costruttore crea un'istanza di un indirizzo IPv6.This constructor instantiates an IPv6 address. scopeid
Identifica un'interfaccia di rete nel caso di un indirizzo locale del collegamento.The scopeid
identifies a network interface in the case of a link-local address. L'ambito è valido solo per indirizzi locali di collegamento e di sito.The scope is valid only for link-local and site-local addresses.
ByteSi presuppone che la matrice sia nell'ordine dei byte di rete con il byte più significativo per primo nella posizione di indice 0.The Byte array is assumed to be in network byte order with the most significant byte first in index position 0.
Si applica a
IPAddress(ReadOnlySpan<Byte>, Int64)
public:
IPAddress(ReadOnlySpan<System::Byte> address, long scopeid);
public IPAddress (ReadOnlySpan<byte> address, long scopeid);
new System.Net.IPAddress : ReadOnlySpan<byte> * int64 -> System.Net.IPAddress
Public Sub New (address As ReadOnlySpan(Of Byte), scopeid As Long)
Parametri
- address
- ReadOnlySpan<Byte>
Valore dell'intervallo di byte dell'indirizzo IP.The byte span value of the IP address.
- scopeid
- Int64
Valore long dell'identificatore di ambito.The long value of the scope identifier.
Eccezioni
address
contiene un indirizzo IP errato.address
contains a bad IP address.
scopeid
< 0scopeid
< 0
-oppure--or-
scopeid
> 0x00000000FFFFFFFFscopeid
> 0x00000000FFFFFFFF
Commenti
Questo costruttore crea un'istanza di un indirizzo IPv6.This constructor instantiates an IPv6 address. scopeid
Identifica un'interfaccia di rete nel caso di un indirizzo locale del collegamento.The scopeid
identifies a network interface in the case of a link-local address. L'ambito è valido solo per indirizzi locali di collegamento e di sito.The scope is valid only for link-local and site-local addresses.
Si presuppone che l'intervallo di byte si trovi nell'ordine dei byte di rete con il byte più significativo per primo nella posizione di indice 0.The byte span is assumed to be in network byte order with the most significant byte first in index position 0.