IPAddress.Loopback IPAddress.Loopback IPAddress.Loopback IPAddress.Loopback Field

定义

提供 IP 环回地址。Provides the IP loopback address. 此字段为只读。This field is read-only.

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

字段值

示例

下面的示例输出Loopback到控制台的地址。The following example prints the Loopback address to the console.

void PrintLoopbackAddress()
{
   // Gets the IP loopback address and converts it to a string.
   String^ IpAddressString = IPAddress::Loopback->ToString();
   Console::WriteLine( "Loopback IP address : {0}", IpAddressString );
}
public void PrintLoopbackAddress()
{
  // Gets the IP loopback address and converts it to a string.
  String IpAddressString = IPAddress.Loopback.ToString();
  Console.WriteLine("Loopback IP address : " + IpAddressString);
}
Public Sub PrintLoopbackAddress()
    ' Gets the IP loopback address and converts it to a string.
    Dim IpAddressString As [String] = IPAddress.Loopback.ToString()
    Console.WriteLine(("Loopback IP address : " + IpAddressString))
End Sub 'PrintLoopbackAddress

注解

Loopback字段等效于 127.0.0.1 采用点分四组表示法。The Loopback field is equivalent to 127.0.0.1 in dotted-quad notation.

适用于