共用方式為


IPAddress.Loopback 欄位

定義

提供 IP 回送位址。 此欄位為唯讀。

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 位址列印到主控台。

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

備註

欄位 Loopback 相當於虛線四邊形表示法中的 127.0.0.1。

適用於