Something like this should work ...
var ips = new[] { IPAddress.Parse( "127.0.0.1"),
IPAddress.Parse( "192.168.1.1"),
IPAddress.Parse( "10.0.0.1" ) };
var ep = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 0);
if (ips[0].Equals(ep.Address))
{
Console.WriteLine("Equal!");
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…