IPAddress.IPv6Loopback 필드

정의

IP 루프백 주소를 제공합니다.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 

필드 값

예제

다음 코드 예제에서는 표준 압축 형식으로 현재 호스트의 루프백 주소 값을 표시합니다.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.
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: {0}", ipv6LoopBack );
   }
   catch ( Exception^ e ) 
   {
      Console::WriteLine( "->Item[displayIPv6LoopBackAddress] Exception: {0}", e );
   }
}
// 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

설명

IPv6Loopback 필드는 콜론 16 진수 표기법의 0:0:0:0:0:0:0:1에 해당 하며, 압축 표기법의 경우:: 1입니다.The IPv6Loopback field is equivalent to 0:0:0:0:0:0:0:1 in colon-hexadecimal notation, or to ::1 in compact notation.

적용 대상