How to find IP Address of Host


VB.Net-Informations.com
SiteMap

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


  • Sponsored Program








More Source Code :
|  Home  |   VB.NET  |   C#  |   ASP.NET  |   SiteMap  |   Terms of Use  |   About  |