IPAddress.IPv6None Campo

Definizione

Fornisce un indirizzo IP che indica che non deve essere utilizzata alcuna interfaccia di rete.Provides an IP address that indicates that no network interface should be used. Questa proprietà è di sola lettura.This property is read-only.

public: static initonly System::Net::IPAddress ^ IPv6None;
public static readonly System.Net.IPAddress IPv6None;
 staticval mutable IPv6None : System.Net.IPAddress
Public Shared ReadOnly IPv6None As IPAddress 

Valore del campo

IPAddress

Esempio

Nell'esempio di codice seguente viene visualizzato il valore dell'indirizzo None dell'host corrente nel formato compresso standard.The following code example displays the value of the current host's None address in standard compressed format.

// This method displays the value of the current host's None address in
// standard compressed format. The None address is used by the host to disable
// listening to client activities on all the interfaces.
void displayIPv6NoneAddress()
{
   try
   {
      // Get the None address.
      IPAddress^ none = IPAddress::IPv6None;
      
      // Transform the None address to a string using the overloaded
      // ToString() method. Note that the resulting string is in the compact
      // form: "::".
      String^ ipv6None = none->ToString();

      Console::WriteLine( "The IPv6 None address is: {0}", ipv6None );
   }
   catch ( Exception^ e ) 
   {
      Console::WriteLine( "->Item[displayIPv6NoneAddress] Exception: {0}", e );
   }
}
// This method displays the value of the current host's None address in
// standard compressed format. The None address is used by the host to disable
// listening to client activities on all the interfaces.
private static void displayIPv6NoneAddress()
{
  try
  {

    // Get the None address.
    IPAddress none  = IPAddress.IPv6None;

    // Transform the None address to a string using the overloaded
    // ToString() method. Note that the resulting string is in the compact
    // form: "::".
    string ipv6None = none.ToString();

    Console.WriteLine("The IPv6 None address is: " + ipv6None);
  }
  catch (Exception e)
  {
    Console.WriteLine("[displayIPv6NoneAddress] Exception: " + e.ToString());
  }
}
' This function prints the value of the current host's None address in  
' standard compressed format. The None address is used by the host to disable
' listening to client activities on all the interfaces.
Private Shared Sub printIPv6NoneAddress()
   Try
      
      ' Get the None address.
      Dim none As IPAddress = IPAddress.IPv6None
      
      ' Transform the None address to a string using the overloaded
      ' ToString() method. Note that the resulting string is in the compact 
      ' form: "::".
      Dim ipv6None As String = none.ToString()
      
      Console.WriteLine(("The IPv6 None address is: " + ipv6None))
   Catch e As Exception
      Console.WriteLine(("[printIPv6NoneAddress] Exception: " + e.ToString()))
   End Try
End Sub

Commenti

Il Socket.Bind metodo usa il IPv6None campo per indicare che un oggetto Socket non deve restare in ascolto dell'attività del client.The Socket.Bind method uses the IPv6None field to indicate that a Socket must not listen for client activity. Il IPv6None campo equivale a 0:0:0:0:0:0:0:0 in notazione esadecimale con due punti oppure a:: 0 in notazione compatta.The IPv6None field is equivalent to 0:0:0:0:0:0:0:0 in colon-hexadecimal notation, or to ::0 in compact notation.

Si applica a