getting IP and MAC address 
Author Message
 getting IP and MAC address

How do I get the IP address and MAC address (network card) using Visual
Basic?  I've been using registry APIs to read/write, but I haven't been
able to find registry keys for IPs and MACs.  Is there a way to do this in
general?  (i.e., I want to write it so that it'll work for anyone using NT)


Sun, 14 Jan 2001 03:00:00 GMT  
 getting IP and MAC address

Quote:

> How do I get the IP address and MAC address (network card) using
> Visual
> Basic?  I've been using registry APIs to read/write, but I haven't
> been
> able to find registry keys for IPs and MACs.  Is there a way to do
> this in
> general?  (i.e., I want to write it so that it'll work for anyone
> using NT)

I use the SocketWrench TCP/IP control with VB 4.0 Standard.

http://www.catalyst.com

It provides IP addresses. Don't know about getting the MAC address
though, but you don't need it for TCP/IP communications on a LAN as IP
takes care of the MAC address resolution automatically.
--
Rod C--
Whitehorse, Yukon, Canada

Quote:
>>It takes a lot of things to prove you are smart, but only one thing to

prove you are ignorant. -- Don Herold<<
The preceding humor inserted by QuipSig
http://www.enc.yk.net/quipsig/

http://yos.yknet.yk.ca/        YukonNet Operating Society



Mon, 15 Jan 2001 03:00:00 GMT  
 getting IP and MAC address


Quote:
> How do I get the IP address and MAC address (network card) using Visual
> Basic?  I've been using registry APIs to read/write, but I haven't been
> able to find registry keys for IPs and MACs.  Is there a way to do this
in
> general?  (i.e., I want to write it so that it'll work for anyone using
NT)

Thanks for all the replies through e-mail and the newsgroup.

I ended up using code someone sent me to read MAC addresses.  It involved
setting up a few things and calling the NetBIOS API.  I couldn't have
written it by myself.

But to get IP addresses on a local host, all I had to do was drop in
"Microsoft Winsock Control 5.0 (SP2)" and read the "LocalHostName" and
"LocalHostIP" properties.



Mon, 15 Jan 2001 03:00:00 GMT  
 getting IP and MAC address

Quote:
>I ended up using code someone sent me to read MAC addresses.  It involved
>setting up a few things and calling the NetBIOS API.  I couldn't have
>written it by myself.

>But to get IP addresses on a local host, all I had to do was drop in
>"Microsoft Winsock Control 5.0 (SP2)" and read the "LocalHostName" and
>"LocalHostIP" properties.

Actually, the current version of SocketWrench (Version 2.2) will
return both the local IP address and MAC address for your network
adapter. It will even allow you to enumerate all of the IP addresses
assigned to your system (in case you have a multi-homed
configuration). If you want to check it out, you can download it from
our website at http://www.catalyst.com (it's a free package).

----

Catalyst Development Corporation          Web:   http://www.catalyst.com



Tue, 16 Jan 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. getting IP and MAC address

2. getting IP and MAC address

3. Getting the ip address based on the MAC Address

4. Getting a machine's MAC address given a NETBIOS machine name or IP address

5. Network adapter question: how to put ip address and MAC addresses together

6. Mapping IP address to MAC address (VB5.0)

7. IP Address & MAC Address

8. VBscript for IP Address, Mac Address, Username

9. MAC Address to IP Address

10. MAC Address to IP Address

11. MAC address --> IP address

12. Get MAC address with IP address

 

 
Powered by phpBB® Forum Software