IPAddress.IPv6Any Campo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Il metodo Bind(EndPoint) utilizza il campo IPv6Any per indicare che una classe Socket deve attendere l'attività dei client su tutte le interfacce di rete.
public: static initonly System::Net::IPAddress ^ IPv6Any;
public static readonly System.Net.IPAddress IPv6Any;
staticval mutable IPv6Any : System.Net.IPAddress
Public Shared ReadOnly IPv6Any As IPAddress
Valore del campo
Esempio
Nell'esempio di codice seguente viene visualizzato il valore dell'indirizzo Any dell'host corrente in formato compresso standard.
// This method displays the value of the current host's Any address in
// standard compressed format. The Any address is used by the host to enable
// listening to client activities on all the interfaces for a given port.
void displayIPv6AnyAddress()
{
try
{
// Get the Any address.
IPAddress^ any = IPAddress::IPv6Any;
// Transform the Any address to a string using the overloaded
// ToString() method. Note that the resulting string is in the compact
// form: "::".
String^ ipv6Any = any->ToString();
// Display the Any address.
Console::WriteLine( "The IPv6 Any address is: {0}", ipv6Any );
}
catch ( Exception^ e )
{
Console::WriteLine( "->Item[displayIPv6AnyAddress] Exception: {0}", e );
}
}
// This method displays the value of the current host's Any address in
// standard compressed format. The Any address is used by the host to enable
// listening to client activities on all the interfaces for a given port.
private static void displayIPv6AnyAddress()
{
try
{
// Get the Any address.
IPAddress any = IPAddress.IPv6Any;
// Transform the Any address to a string using the overloaded
// ToString() method. Note that the resulting string is in the compact
// form: "::".
string ipv6Any = any.ToString();
// Display the Any address.
Console.WriteLine("The IPv6 Any address is: " + ipv6Any);
}
catch (Exception e)
{
Console.WriteLine("[displayIPv6AnyAddress] Exception: " + e.ToString());
}
}
' This function prints the value of the current host's Any address in
' standard compressed format. The Any address is used by the host to enable
' listening to client activities on all the interfaces for a given port.
Private Shared Sub printIPv6AnyAddress()
Try
' Get the Any address.
Dim any As IPAddress = IPAddress.IPv6Any
' Transform the Any address to a string using the overladed
' ToString() method. Note that the resulting string is in the compact
' form: "::".
Dim ipv6Any As String = any.ToString()
' Display the Any address.
Console.WriteLine(("The IPv6 Any address is: " + ipv6Any))
Catch e As Exception
Console.WriteLine(("[printIPv6AnyAddress] Exception: " + e.ToString()))
End Try
End Sub
Commenti
Il IPv6Any campo equivale a 0:0:0:0:0:0:0:0:0 in notazione esadecimale da due punti o a :: in notazione compatta.