Track the Computer Name and IP Address in VB.NET

In this article, we can easily find the detail of computer and server..
  • 11863

 Introduction

In this article, I am going to explain how to find the IP address through the  program. This is helpful for us when we try to know about the name of the computer and IP address of the client system. It also provide the host name & also Dns server name. VB.NET provides the facility of finding the details of any computer by creating your own program. Here is an example through which you can easily find the details of any computer & their server.

DNS: It refers to the domain name system, it is a internet technology that is used to convert domain name to IP addresses.

GetHostName: It is a function that retrieves the host name of the current system.

GetHostEntry: It is a method which sends query to the server for the IP addresses. It also returns the address and information about a given host.

IP addresses: Internet Protocol address is a computer technology that is designed to communicate one computer to another through a internet.

In this we use string for finding the IP address:

PrivateSub Button1_Click (senderAs System.Object, e As System.EventArgs)Handles   Button1.Click

 Dim strHostName AsString
 Dim strIPAddress AsString
        strHostName = System.Net.Dns.GetHostName()
       
 strIPAddress = System.Net.Dns.GetHostEntry(strHostName).AddressList(0).ToString()
       
 MessageBox.Show("Host Name: " & strHostName & "; IP Address: " & strIPAddress)
     EndSub
 End Class

Output of the program is:

 untitled.bmp

The above figure shows the computer name and IP address of the system.

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.