Net-informations.com
SiteMap  | About    

How to find IP Address of Host

Syste.net namespace provide the infomation about IP Address .

vb.net_ip_address.JPG

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






net-informations.com (C) 2017    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.