Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

IPAddress.IPv6Loopback Field

Definition

Namespace:
System.Net
Assemblies:
System.dll, System.Net.Primitives.dll
Assemblies:
netstandard.dll, System.Net.Primitives.dll
Assembly:
System.Net.Primitives.dll
Assembly:
System.dll
Assembly:
netstandard.dll
Source:
IPAddress.cs
Source:
IPAddress.cs
Source:
IPAddress.cs
Source:
IPAddress.cs
Source:
IPAddress.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Provides the IP loopback address. This property is read-only.

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

Field Value

Examples

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());
 }
}
' This methods prints the value of the current host loopback address in 
' standard compressed format. 
Private Shared Sub printIPv6LoopBackAddress()
 Try
 ' Get the loopback address.
 Dim loopBack As IPAddress = IPAddress.IPv6Loopback
 
 ' Transform the loop-back address to a string using the overloaded
 ' ToString() method. Note that the resulting string is in the compact 
 ' form: "::1".
 Dim ipv6LoopBack As String = loopBack.ToString()
 Console.WriteLine(("The IPv6 Loopback address is: " + ipv6LoopBack))
 Catch e As Exception
 Console.WriteLine(("[printIPv6LoopBackAddress] Exception: " + e.ToString()))
 End Try
End Sub

Remarks

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

Applies to


Feedback

Was this page helpful?