Get or set the IP address of the endpoint in CSharp

Description

The following code shows how to get or set the IP address of the endpoint.

Example


using System;//w w w  . j  ava  2 s  .  co m
using System.Net;
using System.Net.Sockets;

public class Example
{
    public static void Main()
    {
        IPAddress hostIPAddress1 = IPAddress.Parse("127.0.0.1");
        IPEndPoint endpoint = new IPEndPoint(hostIPAddress1, 80);
        Console.WriteLine("Endpoint.Address : " + endpoint.Address);
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    Network »




IP
Web Client