Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find out the IP-number of your computer using winsock

Networks

Find out the IP-number of your computer using winsock

by  Painkiller  Posted    (Edited  )
I use this method to find out the IP-adress of a computer instead of using an API.

Install the microsoft winsock 6.0 control in your project and drag it to your form. Place a textbox and commandbutton in your form.

use the following code:

Private Sub Command1_Click()

Text1.Text = Winsock1.LocalIP

End Sub

You can also find out the name of your computer with the following code (with a second textbox):

Text2.Text = Winsock1.LocalHostName


Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top