Create IP Address from a Byte array in CSharp

Description

The following code shows how to create IP Address from a Byte array.

Example


using System;// w  ww.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(new byte[]{23,32,23,23});
        Console.WriteLine(address.ToString());
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    Network »




IP
Web Client