Results 1 to 8 of 8

Thread: Network Adapters???

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 1999
    Location
    Singapore
    Posts
    32

    Question

    I say, does anyone know how to retrieve a list of network adapters, and query each one for it's IP address?

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    The list is in the registry, with all of their details.

    - jamie
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 1999
    Location
    Singapore
    Posts
    32
    Hm...that's helpful... unfortunately... what key(s) must I look under?

  4. #4
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Class\NetTrans

    Enumerate through each jobby in there.



    - jamie
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  5. #5

    Thread Starter
    Member
    Join Date
    Jun 1999
    Location
    Singapore
    Posts
    32
    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?)

  6. #6
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    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
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  7. #7

    Thread Starter
    Member
    Join Date
    Jun 1999
    Location
    Singapore
    Posts
    32
    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.

  8. #8
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    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
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width