Local IP Address Finder - Visual Basic .NET
Tags: VB.NET, VB 2008, VB 2010, VB 2012, VB 2013
This tutorial will show you how to find out the IP Address.
Add a button to the form, and change it's text to Get IP:
Add a Label and a TextBox to the form. Change the label text to IP Address:
We will add one control that is not included in the toolbox:
On the Toolbox: right click the mouse and click on Choose Items...:
A Window will appear: Click on COM Components.
Scroll down to Microsoft WinSock Control, version 6.0 and check it.
Click OK. This will add the WinSock control to the ToolBox:
Drag the WinSock Control the Form:
Add the following code that handles the button click event to retrieve the ip address
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox1.Text = AxWinsock1.LocalIP End Sub
Run the program and click on Get IP button. Your IP Address should appear inside the text box: