Categories
7.0 7.5 C#.NET HOW TO Microsoft Nokia VB.NET Visual Studio Windows Phone

HOW TO create endpoint with Hostname or IP address in Silverlight

There are some classes in the Namespace System.Net

With Hostname use the following Class

DnsEndPoint

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

IPEndPoint

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.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.