IPAddress.IPv6Loopback Field
.NET Framework 4
Provides the IP loopback address. This property is read-only.
Assembly: System (in System.dll)
The following code example displays the value of the current host's loopback address in standard compressed format.
// This method displays the value of the current host loopback address in // standard compressed format. private static void displayIPv6LoopBackAddress() { try { // Get the loopback address. IPAddress loopBack = IPAddress.IPv6Loopback; // Transform the loop-back address to a string using the overladed // ToString() method. Note that the resulting string is in the compact // form: "::1". string ipv6LoopBack = loopBack.ToString(); Console.WriteLine("The IPv6 Loopback address is: " + ipv6LoopBack); } catch (Exception e) { Console.WriteLine("[displayIPv6LoopBackAddress] Exception: " + e.ToString()); } }
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.