Resolve Website IP using VB.NET

This tutorial will teach you how to Resolve Website IP using VB.NET. This will resolve IP of any IP Addresses. Now, let's start this tutorial! 1. Let's start with creating a Windows Form Application for this tutorial by following the following steps in Microsoft Visual Studio: Go to File, click New Project, and choose Windows Application. 2. Next, add two textboxes named txtHost for inputting the hosting websites and txtIP for displaying the websites resolved IP address and one button that will trigger to view the IP address. You must design your interface like this: output 3. Now, lets do the coding. We will just create a public function named ResolveDNS as a string variable and will get the IPHostEntry, the IP address, and the address of the host.
  1. Public Shared Function ResolveDNS(ByVal Host As String) As String
  2.  
  3. Dim Entry As Net.IPHostEntry = Net.Dns.GetHostEntry(Host)
  4. Dim Address As Net.IPAddress() = Entry.AddressList
  5. Return Address.GetValue(0).ToString
  6.  
  7. End Function
Lastly, for clicking the button, we will just call the function that we have created above to call the resolved IP of the host.
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2.  
  3. txtIP.Text = ResolveDNS(txtHost.Text)
  4.  
  5. End Sub

Output:

output Download the code and try it! For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below. Best Regards, Engr. Lyndon Bermoy IT Instructor/System Developer/Android Developer/Freelance Programmer Mobile: 09488225971 Landline: 826-9296 E-mail:[email protected] Add and Follow me on Facebook: https://www.facebook.com/donzzsky Visit and like my page on Facebook at: https://www.facebook.com/BermzISware

Add new comment