Winsock IP address query (multiple)

I want to make a VB6 app that can
a) show my computer name and IP Address and
b) show IP Address and comp names of other PCs on the network
c) query a single comp name/IP address as typed in by user

A and C should be easy enough to figure out, but what about B?
do i need an instance of this program running on connected PCs to do it or can i use something else, even if i wasn't connected to LAN when system booted up - connect to sitch later?

solution + VB6 coding would be appreciated
(also, sometimes my IP address appears as real IP address (168.192.100.1) and sometimes as lookback adapter (127.0.0.1) depending on what pc i run program on. Why is it so and how can i fix it?)

Thanks - Ryan R
LVL 15
Ryan_RIT Systems AdministratorAsked:
Who is Participating?
 
Ryan_RIT Systems AdministratorAuthor Commented:
so if i clicked a button on my form a list box would be filled with all the IP addresses and names on my network
0
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
The easiest way to retrieve the IP address assigned to the local machine during an Internet session is by means of the LocalIP property of the Internet Transfer Control:
MsgBox "IP address= " & Winsock1.LocalIp

using API:
http://www.developerfusion.co.uk/show/1851/

Get the computer name:
http://www.veign.com/vrc_codeview.asp?type=app&id=7

get all the computer names in your domain:
http://www.freevbcode.com/ShowCode.Asp?ID=703

0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
Ryan_RIT Systems AdministratorAuthor Commented:
ok so far so good.
how about using this on different networks?
ie Domain, Workgroup, and Novell Client/Server network on top of Win XP?
0
 
Ryan_RIT Systems AdministratorAuthor Commented:
saved links to HDD - will review them when i have more time
until later, ryan
0
 
callrsCommented:
Hi Ryan. Please see http://www.geocities.com/callrs/eeDeleted.htm & reply by email if you can get cached copy. Thanks.
0
 
Ryan_RIT Systems AdministratorAuthor Commented:
can't get geocities at school: banned, will try later, thanks
0
 
Ryan_RIT Systems AdministratorAuthor Commented:
sorry i've completey forgotton about this post guys, will endeavour to try out solutions soon and accept an answer.
0
 
Ryan_RIT Systems AdministratorAuthor Commented:
http://www.freevbcode.com/ShowCode.Asp?ID=703

i have tried this example with no success, when i use the listbox.add command or any command to view the data (ie msgbox) i get the error Type Mismatch.

any ideas
0
 
Ryan_RIT Systems AdministratorAuthor Commented:
and while im at it already was using winsock for local ip as stated somewhat in original question

http://www.devcity.net/forums/faq.asp?tid=1712 (as found in http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21858688.html)
tried this also without success - the error i belive being on the line of code where it reffers to something.ADODB or something - was i supposed to add a reference or something in my project for this example

if i can get your ideas on this and get it working then i can easily accept an answer here - thanks everyone
0
 
Ryan_RIT Systems AdministratorAuthor Commented:
ok i have had limited success with a few suggestions now so i think it's feeding time at the EE zoo (yippee)
thanks for all your help
0
 
Ryan_RIT Systems AdministratorAuthor Commented:


it's not possible to list PCs that are not in my workgroup, is it?

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.