IPAddress.IPv6Any Field

Provides an IPv6 address that indicates that a server must listen for client activity on all network interfaces for IPv6. This field is read-only.

Namespace:  System.Net
Assembly:  System.Net (in System.Net.dll)

public static readonly IPAddress IPv6Any

The IPv6Any field is equivalent to 0:0:0:0:0:0:0:0 in colon-hexadecimal notation, or to :: in compact notation.

The IPv6Any field is defined even when the Socket.OSSupportsIPv6 property is false.

The following code example displays the value of the current host's IPv6 Any address.

  // 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.
        // 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.
        outputBlock.Text += "The IPv6 Any address is: ";
        outputBlock.Text += ipv6Any;
        outputBlock.Text += "\n";

      catch (Exception e) 
        outputBlock.Text += "Exception: ";
        outputBlock.Text += e.ToString();
        outputBlock.Text += "\n";


Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.