Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

IPAddress.Loopback Field

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

[Visual Basic]
Public Shared ReadOnly Loopback As IPAddress
[C#]
public static readonly IPAddress Loopback;
[C++]
public: static IPAddress* Loopback;
[JScript]
public static var Loopback : IPAddress;

Remarks

The Loopback field is equivalent to 127.0.0.1 in dotted-quad notation.

Example

[Visual Basic, C#, C++] The following example prints the Loopback address to the console.

[Visual Basic] 
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

[C#] 
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);
}

[C++] 
void PrintLoopbackAddress() {
   // Gets the IP loopback address and converts it to a string.
   String* IpAddressString = IPAddress::Loopback->ToString();
   Console::WriteLine(S"Loopback IP address : {0}", IpAddressString);
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

IPAddress Class | IPAddress Members | System.Net Namespace

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.