6 Replies Latest reply on Dec 1, 2010 12:46 PM by jakehilton

    Mac address in Adobe AIR2

    sss999sss

      HI

       

      I am facing problem with mac address reading. I am able to read mac address from NIC card when it is connected to network via wired or wire less.

       

      I want to read mac address from NIC without wired or wire less,  how can i read this.

       

      Thanks in advance to all.

       

       

       

      Regards

      ---------

      sss

        • 1. Re: Mac address in Adobe AIR2
          mihnea1975 Adobe Employee

          Hi,

           

          Would it be ok for you to post the piece of code you are using to read the address? I assume you are using the same code to successfully read the address when you are connected. What version of MAC are you using? What version of AIR are you using?

           

          Regards,

          Mihnea Ovidenie

          AIR Engineering

          • 2. Re: Mac address in Adobe AIR2
            sss999sss Level 1

            Hi Mihnea Ovidenie,

             

            Thanks for your reply.

             

            I am using the below code to read network interfaces

             

            var results:Vector.<NetworkInterface> = NetworkInfo.networkInfo.findInterfaces();

             

            I am using results[i].hardwareAddress to read MAC address from results vector. When i connected my NIC to  network using wired or wireless, the above code was working fine. But when i am not connected to network, i am unable to read MAC address from NIC cards.

             

            Is it possible to read MAC from address i.e.., hardware address from NIC(Network Interface Cards)  cards when it is not connected to a network?

             

            Environment:

             

            Operating System: Windows XP professional

            Adobe AIR vrsion:2.0

            Adobe flex Builder:3.5

            • 3. Re: Mac address in Adobe AIR2
              mihnea1975 Adobe Employee

              Hi,

               

              When a card is not connected to a network (or disabled in the case of wireless), the associated interface is not listed in the array returned by findInterfaces (which relies on local OS API to retrieve this information). So it is not possible to get the MAC address for a not connected NIC.

               

              Regards,

              Mihnea Ovidenie

              AIR Engineering

              • 4. Re: Mac address in Adobe AIR2
                sss999sss Level 1

                Hi Mihnea Ovidenie,

                 

                You are right,  it is not possible to get the MAC address for a not connected NIC.

                 

                I solved my problem in another way, I returned code using "C-language". through the "C-language i generated an EXE file". I catch the information in EXE file using "Native process" in Adobe AIR2.0.

                 

                Regards

                ----------

                sss.

                • 5. Re: Mac address in Adobe AIR2
                  mihnea1975 Adobe Employee

                  Hi,

                   

                  Is it possible to share the situation in which you need the MAC address of a non-plugged network card? What are you trying to achieve? You can mail me in private at the following address: mihnea@adobe.com

                   

                  Thanks,

                  Mihnea Ovidenie

                  AIR Engineering

                  • 6. Re: Mac address in Adobe AIR2
                    jakehilton Level 1

                    I would like to use the mac address for verification that the application wasn't dropped onto another computer. When the app registers itself it passes back the mac address of the NIC. I know that if the nic were switched that it would cause issues but I'm willing do deal with this.

                     

                    I just wonder why even when a NIC is not connected the OS can still report on the mac address.. and you said that AIR leans on the OS for this info. So there seems to be a bit of a disconnect.

                     

                    Thanks,
                    Jake