Create IPEndPoint class with the specified address and port number. : IP Address « Network Remote « VB.Net






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

1.Get your IP address
2.IPAddress.Address
3.IPAddress.Broadcast Field provides the IP broadcast address. This field is read-only.
4.IPAddress.Loopback
5.IPAddress.None indicates that no network interface should be used. This field is read-only.
6.IPAddress.Parse converts an IP address string to an IPAddress instance.
7.IPEndPoint.Create creates an endpoint from a socket address.
8.Serializes endpoint information into a SocketAddress instance.