There are some classes in the Namespace System.Net
With Hostname use the following Class
an example in C#
[sourcecode lang=”csharp”]DnsEndPoint endpoint = new DnsEndPoint("https://www.myerrorsandmysolutions.com", 80);[/sourcecode]
in VB.NET
[sourcecode lang=”vbnet”]Dim endpoint As New DnsEndPoint("https://www.myerrorsandmysolutions.com", 80)[/sourcecode]
With IP address use the following Class
an example in C#
[sourcecode lang=”csharp”]IPEndPoint endpoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 80);[/sourcecode]
in VB.NET
[sourcecode lang=”vbnet”]Dim endpoint As New IPEndPoint(IPAddress.Parse("127.0.0.1"), 80)[/sourcecode]
Did my HOW TO help you? Leave a reply.