By: Issac Emailed: 1758 times Printed: 2452 times
Here is a simple code for you to find the IP address of a host machine System.net namespace provides the information about IP Address.
If you pass localhost in GetHostByName return the IP Address of local machine.
Imports System.Net Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click Dim hostname As IPHostEntry = Dns.GetHostByName(TextBox1.Text) Dim ip As IPAddress() = hostname.AddressList TextBox2.Text = ip(0).ToString() End Sub End Class
This source code returns the ip address of the host you are working with.
Be the first one to add a comment
Most Viewed Articles (in VB.net )
Most Emailed Articles (in VB.net)