using System.Net; var endpoint = new IPEndPoint(IPAddress.Parse("192.168.1.1"), 8080);
using System.Net; var endpoint1 = new IPEndPoint(IPAddress.Parse("192.168.1.1"), 8080); var endpoint2 = new IPEndPoint(IPAddress.Parse("192.168.1.1"), 8080); if(endpoint1.Equals(endpoint2)){ Console.WriteLine("Endpoints are equal."); }This code creates two IPEndPoint objects and compares them for equality using the Equals method. The System.Net EndPoint class is part of the .NET Base Class Library.