Map IPAddress object to an IPv4 address in CSharp

Description

The following code shows how to map IPAddress object to an IPv4 address.

Example


using System;/*ww  w  .j  a  v  a  2s .  c  o m*/
using System.Net;
using System.Net.Sockets;

public class Example
{
   public static void Main()
   {
        IPAddress address = new IPAddress(0x2112188f);
        Console.WriteLine(address.MapToIPv4());

   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    Network »




IP
Web Client