İngilizce dilinde oku

Aracılığıyla paylaş


IPAddress.IPv6Any Alan

Tanım

yöntemi, Bind(EndPoint) tüm ağ arabirimlerinde istemci etkinliğini dinlemesi Socket gerektiğini belirtmek için alanını kullanırIPv6Any.

C#
public static readonly System.Net.IPAddress IPv6Any;

Alan Değeri

Örnekler

Aşağıdaki kod örneği, geçerli konağın Herhangi bir adresinin değerini standart sıkıştırılmış biçimde görüntüler.

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

Açıklamalar

Alan IPv6Any , iki nokta üst üste onaltılık gösteriminde 0:0:0:0:0:0:0 veya sıkıştırılmış gösteriminde :: ile eşdeğerdir.

Şunlara uygulanır

Ürün Sürümler
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0