PDA

Click to See Complete Forum and Search --> : Network Adapters???


atjs
Feb 12th, 2001, 04:13 AM
I say, does anyone know how to retrieve a list of network adapters, and query each one for it's IP address?

plenderj
Feb 12th, 2001, 05:05 AM
The list is in the registry, with all of their details.

- jamie

atjs
Feb 12th, 2001, 05:43 AM
Hm...that's helpful... unfortunately... what key(s) must I look under?

plenderj
Feb 12th, 2001, 05:53 AM
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Class\NetTrans

Enumerate through each jobby in there.

;)

- jamie

atjs
Feb 13th, 2001, 08:42 PM
Hm..okay.. if I use the Winsock control and bind it to the IP addresses it should bind to the adapter right?

'Cause I'm kinda worried about the 0000 key for the Dial Up Adapter. The IP address shows 0.0.0.0 whether I'm connected or not. Do I just need to bind Winsock to 0.0.0.0 to select the Dialup Adapter?

And what happens if my NIC is set to a static 192.168.0.2 and I change it to a automatically assigned IP? Will I still get that dynamic IP in the registry? (every time I boot up?)

plenderj
Feb 14th, 2001, 02:08 AM
Well,
In my laptop here I have a Xircom 10/100 Network card, and an internal lucent modem. I also used use another network card, so its settings are in there too.

I have a static IP of 192.168.1.11 for my Xircom card.

If I ever use a winsock control, it always binds to the xircom card. So there would appear to be even a little intelligence there.

In relation to DHCP, if you use DHCP, the winsock control will bind to whatever IP Address has been assigned to you.

- jamie

atjs
Feb 14th, 2001, 03:02 AM
Hm..I don't really get it. All I need to do is bind the winsock control to my dialup adapter or network card at will. As far as I know, I need to have the IP addresses for any interface so I can feed it to the winsock .bind property.

When I connect to the Net using my dialup modem, I get an IP say: 202.42.122.231. I don't get any hits when I search the registry for this during the connection.

Perhaps to rephrase the question, it would now be: How do I bind the winsock control to a interface which has a dynamically changing IP?

If I set my network card to be allocated a dynamic IP, the IP value I get in the registry is 0.0.0.0, which is the same as the dialup adapter. So I suppose it doesn't work that way.

plenderj
Feb 14th, 2001, 04:10 AM
Well you dont need to know the ip address.
If you're using UDP, just Winsock1.Bind, and if you're using TCP just Winsock1.Listen.

Simple as that.

- jamie