Export (0) Print
Expand All

IPAddress.IPv6None Field

Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

Provides an IP address indicating that no network interface should be used. This property is read-only.

[Visual Basic]
Public Shared ReadOnly IPv6None As IPAddress
[C#]
public static readonly IPAddress IPv6None;
[C++]
public: static IPAddress* IPv6None;
[JScript]
public static var IPv6None : IPAddress;

Remarks

The Socket.Bind method uses the IPv6None field to indicate that a Socket should not listen for client activity. The IPv6None field is equivalent to 0:0:0:0:0:0:0:0 in colon-hexadecimal notation, or to::0 in compact notation.

Example

[Visual Basic, C#, C++] The following code example displays the value of the current host's None address in standard compressed format.

[Visual Basic] 
' 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 'printIPv6NoneAddress


[C#] 
// 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());
  }
}

[C++] 
// 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(S"The IPv6 None address is: {0}", ipv6None);
   } catch (Exception* e) {
      Console::WriteLine(S"->Item[displayIPv6NoneAddress] Exception: {0}", e);
   }
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

IPAddress Class | IPAddress Members | System.Net Namespace

Show:
© 2014 Microsoft