IPAddress ipAddress = IPAddress.Parse("192.168.1.1"); int port = 80; IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, port);
string hostname = "google.com"; int port = 80; IPAddress[] ipAddresses = Dns.GetHostAddresses(hostname); IPEndPoint ipEndPoint = new IPEndPoint(ipAddresses[0], port);
string ipEndPointStr = ipEndPoint.ToString();Package library: The System.Net.IPEndPoint class is part of the System.Net.NameSpace, which is included in the .NET Framework.