static void Main(string[] args) { byte[] a = new byte[4]; for (int i = 0; i < a.Length; i++) { a[i] = 10; } IPAddress ip = new IPAddress.Parse("192.168.1.10"); Console.WriteLine("IP: {0}", ip); Console.WriteLine("Any: {0}", IPAddress.Any); Console.WriteLine("Broadcast: {0}", IPAddress.Broadcast); Console.WriteLine("Loopback: {0}", IPAddress.Loopback); /*IPEndPoint ipe = new IPEndPoint(IPAddress.Parse("123.123.12.13"), 12345); * Console.WriteLine("IpEndpoint: {0}", ipe); * Console.WriteLine("IP: {0}", ipe.Address); * Console.WriteLine("IP: {0}", ip.AddressFamily);*/ IPHostEntry iphe = Dns.GetHostEntry("www.google.com"); foreach (IPAddress i in iphe.AddressList) { Console.WriteLine("IP: {0}", i); } Console.ReadKey(); }
return(new IPEndPoint(IPAddress.Parse(tuple.Item1 ?? string.Empty), tuple.Item2));
remotePoint = new IPEndPoint(IPAddress.Parse(ip), port);