Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Hardware & Devices
  4. Is there any definite range for index of an network adapter?

Is there any definite range for index of an network adapter?

Scheduled Pinned Locked Moved Hardware & Devices
databasesysadminquestion
16 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A an89

    Hi all, do value of index of the ethernet cards and also wireless adapters :confused:in pc have any definite range?:confused:

    D Offline
    D Offline
    Dave Kreskowiak
    wrote on last edited by
    #2

    Indeex range?? What are you talking about?? Where are you looking that shows you an Index?

    A guide to posting questions on CodeProject[^]
    Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
         2006, 2007, 2008

    A 1 Reply Last reply
    0
    • D Dave Kreskowiak

      Indeex range?? What are you talking about?? Where are you looking that shows you an Index?

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      A Offline
      A Offline
      an89
      wrote on last edited by
      #3

      Each network adapter has an ip address,subnet mask attached with it,right?Similarly,an network adapter also has an index associated with it,through which we can bind a scoket to it.the ethernet adapter that i have has index 2.so,i am asking whether there is some range for index of an network adapter?

      D 1 Reply Last reply
      0
      • A an89

        Each network adapter has an ip address,subnet mask attached with it,right?Similarly,an network adapter also has an index associated with it,through which we can bind a scoket to it.the ethernet adapter that i have has index 2.so,i am asking whether there is some range for index of an network adapter?

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #4

        OK. The range you're talking about is technically 0 to Int32.Max. Though, system resources limits that to probably a few thousand adapters.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        A 1 Reply Last reply
        0
        • D Dave Kreskowiak

          OK. The range you're talking about is technically 0 to Int32.Max. Though, system resources limits that to probably a few thousand adapters.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          A Offline
          A Offline
          an89
          wrote on last edited by
          #5

          I didn't get your answer.see i have to develope an application in which i have to distinguish out of the network adapter cards available in the system,which one is ethernet and which one is wireless.Its easy to know which one is ethernet but for wireless i am not getting anything.But one think that I have noticed is index number for ethernet is genearlly 2,3etc and for wireless its 65530 etc.I was thinking to distinguish both referring to the index number.I hope u now understand what my problem is.Pls help if u have any answer to it.Thanks...

          D 1 Reply Last reply
          0
          • A an89

            I didn't get your answer.see i have to develope an application in which i have to distinguish out of the network adapter cards available in the system,which one is ethernet and which one is wireless.Its easy to know which one is ethernet but for wireless i am not getting anything.But one think that I have noticed is index number for ethernet is genearlly 2,3etc and for wireless its 65530 etc.I was thinking to distinguish both referring to the index number.I hope u now understand what my problem is.Pls help if u have any answer to it.Thanks...

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #6

            an89 wrote:

            number for ethernet is genearlly 2,3etc and for wireless its 65530

            That's the wrong way to go about it. You have to query each adapter to get it's type. You don't say what you're using to get the adapters list. I'll suggest using WMI to make it real easy to tell the difference. Check out the Win32_NetworkAdapter[^] class.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008

            A 1 Reply Last reply
            0
            • D Dave Kreskowiak

              an89 wrote:

              number for ethernet is genearlly 2,3etc and for wireless its 65530

              That's the wrong way to go about it. You have to query each adapter to get it's type. You don't say what you're using to get the adapters list. I'll suggest using WMI to make it real easy to tell the difference. Check out the Win32_NetworkAdapter[^] class.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007, 2008

              A Offline
              A Offline
              an89
              wrote on last edited by
              #7

              I have used GetAdapterAddress and GetAdapterInfo which are part of win32 API to get list of interfaces.But the problem is that for ethernet everything is showing fine.But for wireless adapter the type it is returning is "ethernet".But it is returning all other information correctly about the wireless adapter such as ipaddress,index and name.I don't know why its happening.and I can't use WMI.

              D 1 Reply Last reply
              0
              • A an89

                I have used GetAdapterAddress and GetAdapterInfo which are part of win32 API to get list of interfaces.But the problem is that for ethernet everything is showing fine.But for wireless adapter the type it is returning is "ethernet".But it is returning all other information correctly about the wireless adapter such as ipaddress,index and name.I don't know why its happening.and I can't use WMI.

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #8

                OK. Look at Interfaces, not Adapters. You can get the media type (IEEE802.11 - Radio Spread Spectrum) from the Interfaces table. Check into the GetIf* functions instead.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007, 2008

                A 1 Reply Last reply
                0
                • D Dave Kreskowiak

                  OK. Look at Interfaces, not Adapters. You can get the media type (IEEE802.11 - Radio Spread Spectrum) from the Interfaces table. Check into the GetIf* functions instead.

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                       2006, 2007, 2008

                  A Offline
                  A Offline
                  an89
                  wrote on last edited by
                  #9

                  I didn't get you.Could you please give me some links or some source code so as to understand what you have specified.Thanks....

                  D 1 Reply Last reply
                  0
                  • A an89

                    I didn't get you.Could you please give me some links or some source code so as to understand what you have specified.Thanks....

                    D Offline
                    D Offline
                    Dave Kreskowiak
                    wrote on last edited by
                    #10

                    GetIfTable[^] If you look at the left side, you'll see all the GetIf* functions.

                    A guide to posting questions on CodeProject[^]
                    Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                         2006, 2007, 2008

                    A 1 Reply Last reply
                    0
                    • D Dave Kreskowiak

                      GetIfTable[^] If you look at the left side, you'll see all the GetIf* functions.

                      A guide to posting questions on CodeProject[^]
                      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                           2006, 2007, 2008

                      A Offline
                      A Offline
                      an89
                      wrote on last edited by
                      #11

                      Thanks for your help but It didn't help either.The function displays type of wireless as ethernet.If you know any other method pls do reply.

                      D 1 Reply Last reply
                      0
                      • A an89

                        Thanks for your help but It didn't help either.The function displays type of wireless as ethernet.If you know any other method pls do reply.

                        D Offline
                        D Offline
                        Dave Kreskowiak
                        wrote on last edited by
                        #12

                        Yes, it does tell you. That's the only method besides WMI to get what you want. The Type should have come back as IEEE802.11. If it didn't, then it's the fault of the driver for your adapter. dwType can currently come back with 144 different interface types.

                        A guide to posting questions on CodeProject[^]
                        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                             2006, 2007, 2008

                        A 1 Reply Last reply
                        0
                        • D Dave Kreskowiak

                          Yes, it does tell you. That's the only method besides WMI to get what you want. The Type should have come back as IEEE802.11. If it didn't, then it's the fault of the driver for your adapter. dwType can currently come back with 144 different interface types.

                          A guide to posting questions on CodeProject[^]
                          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                               2006, 2007, 2008

                          A Offline
                          A Offline
                          an89
                          wrote on last edited by
                          #13

                          no the type came as "ethernet".In Linux also the type for wireless adapter comes as "ethernet" when you give ifconfig.U can try it also.

                          D 1 Reply Last reply
                          0
                          • A an89

                            no the type came as "ethernet".In Linux also the type for wireless adapter comes as "ethernet" when you give ifconfig.U can try it also.

                            D Offline
                            D Offline
                            Dave Kreskowiak
                            wrote on last edited by
                            #14

                            I don't care, because I use WMI to do this stuff and it's not lying to me. I already told you that this is the ONLY way to get the data you want, save for using WMI, which you "can't use". There is no other option. If it lies to you, there's nothing you can do about it. Well, other than see if the manufacturer of your wireless adapter has updated drivers, because that's where this data is coming from.

                            A guide to posting questions on CodeProject[^]
                            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                                 2006, 2007, 2008

                            A 1 Reply Last reply
                            0
                            • D Dave Kreskowiak

                              I don't care, because I use WMI to do this stuff and it's not lying to me. I already told you that this is the ONLY way to get the data you want, save for using WMI, which you "can't use". There is no other option. If it lies to you, there's nothing you can do about it. Well, other than see if the manufacturer of your wireless adapter has updated drivers, because that's where this data is coming from.

                              A guide to posting questions on CodeProject[^]
                              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                                   2006, 2007, 2008

                              A Offline
                              A Offline
                              an89
                              wrote on last edited by
                              #15

                              mine is not a built-in adapter.its a USB adapter.Can that be a reason for it?

                              D 1 Reply Last reply
                              0
                              • A an89

                                mine is not a built-in adapter.its a USB adapter.Can that be a reason for it?

                                D Offline
                                D Offline
                                Dave Kreskowiak
                                wrote on last edited by
                                #16

                                I have no idea. I'm not going to repeat the bottom line for a third time.

                                A guide to posting questions on CodeProject[^]
                                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                                     2006, 2007, 2008

                                1 Reply Last reply
                                0
                                Reply
                                • Reply as topic
                                Log in to reply
                                • Oldest to Newest
                                • Newest to Oldest
                                • Most Votes


                                • Login

                                • Don't have an account? Register

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • World
                                • Users
                                • Groups