Dear Friends,

can any one help me to find IP address of my computer with the help of simple programing in visual basic?

Isn't it 127.0.0.1? I used that when I needed to chat with the SQL Server on the computer my app was running.

Which address do you want?
Could be the public address supplied by your ISP
Could be the local address supplied by your router
Could be 127.0.0.1 as above if you want to refer to the computer you are on

commented: And I forget to ask which Visual Basic. The actual code to find those other 2 may look very different in VB.Net or VB6. +15

On my system (laptop - wireless) I can get that info under VB.NET 2017 by

Imports System.Net.NetworkInformation

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        For Each nwi As NetworkInterface In NetworkInterface.GetAllNetworkInterfaces
            If nwi.OperationalStatus = OperationalStatus.Up Then
                If nwi.NetworkInterfaceType = NetworkInterfaceType.Wireless80211 Then
                    Debug.WriteLine(nwi.Name & " is " & nwi.OperationalStatus.ToString)
                    For Each ip As UnicastIPAddressInformation In nwi.GetIPProperties.UnicastAddresses
                        Debug.WriteLine("Address is: " & ip.Address.ToString)
                    Next
                End If
            End If
        Next

    End Sub

End Class
commented: Does that give the LAN address or the WAN address? +15
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.