Create IPEndPoint class with the specified address and port number.
Imports System.IO
Imports System.Net
Imports System.Text
public class MainClass
Shared Sub Main()
Dim hostIPAddress1 As IPAddress = Dns.Resolve("google.com").AddressList(0)
Dim hostIPEndPoint As New IPEndPoint(hostIPAddress1, 80)
Console.WriteLine((ControlChars.Cr + "IPEndPoint information:" + hostIPEndPoint.ToString()))
Console.WriteLine((ControlChars.Cr + ControlChars.Tab + "Maximum allowed Port Address :" + IPEndPoint.MaxPort.ToString()))
Console.WriteLine((ControlChars.Cr + ControlChars.Tab + "Minimum allowed Port Address :" + IPEndPoint.MinPort.ToString()))
Console.WriteLine((ControlChars.Cr + ControlChars.Tab + "Address Family :" + hostIPEndPoint.AddressFamily.ToString()))
End Sub
End Class
Related examples in the same category