Hi all, can you use API to get the IP addresses of other computers on a LAN network? I'll like to know the code.
Can you also assist me with a code that will indicate if a computer is connected to a network via LAN cable?
THANKS!!!
Printable View
Hi all, can you use API to get the IP addresses of other computers on a LAN network? I'll like to know the code.
Can you also assist me with a code that will indicate if a computer is connected to a network via LAN cable?
THANKS!!!
in response to your first question - Do you mean get the IP of every machine on the network or do you mean get the IP of specific PCs?
in response to your second question - do you mean you just want to check if the machine is actually connected to the network or do you mean you want to know if they are connected via ethernet cable or wireless?
Also, what research and code have you got so far?
Hi Chris, I mean a code that will get the IP address of every machine on the network.
Secondly, a code that will check if the machine is actually connected to a network via LAN only.
I'm kinda new in the VB6 game. I did some research and found out something about APIs. Haven't yet got a working code.
Can u help?
You have another option,
You can cmd the command and catch the out put in to a text file.
CMD> NET view > C:\computers.txt
You need to excute this form your vb app.
*net view or some command, i forget :D
Edited : arp -a is the command it look like. i dont have a network here to check.
Ah sorry I didnt realise you were using VB6. One question though, if you are new to VB6, why not just start with VB.NET? The only reason anyone uses VB6 now is because they have spent years using it... or they have to support a system that was already written in VB6. If your not in either of those situations then I would recommend learning VB.NET instead.Quote:
Originally Posted by Souldx7
Thanks, but I'm not that new to vb6. I've already gone as far as studying API but I have NO idea how to call them or code them.
About using cmd, how do i link it from VB, my expertise ain't that great. I just know the basics. :(
yah, you just output the cmd to a text file and read form it.
ie.check this thread for all CMD Shellings.Code:Private Sub Command1_Click()
Call Shell(Environ("COMSPEC") & " /c ipconfig > c:\output.txt", vbHide)
End Sub
http://www.vbforums.com/archive/index.php/t-364219.html
BTW, To list all ip's in a network in command problem, i am still forget the comaand. so pls post a question in our general computer section.