C# IPAddress Loopback

Description

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

Syntax

IPAddress.Loopback has the following syntax.


public static readonly IPAddress Loopback

Example

The following example prints the Loopback address to the console.


using System;//  w  w  w.j  a  va 2s.  c  o  m
using System.Net;
using System.Net.Sockets;

public class Example
{
   public static void Main()
   {
      // Gets the IP loopback address and converts it to a string.
      String IpAddressString = IPAddress.Loopback.ToString();
      Console.WriteLine("Loopback IP address : " + IpAddressString);
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Net »




Cookie
Dns
IPAddress
IPEndPoint
IPHostEntry
WebClient