c++ - How to get hardware MAC address on Windows -
I am playing with the retrieval of MAC address from NIC - there are several ways to get it, this article is the most Common cover:
I am currently using GetAdaptersInfo method, which seems to be the most bulletproof, but if MAC address is set through the registry:
Then it reports the MAC address it has been changed. The only way I actually get the true Mac is to remove the registry entry, restart the NIC, get the Mac through GetAdaptersInfo, then change the registry entry and restart the NIC. Although this work is completed, it is rarely transparent for the user.
Is there any other way that is familiar with someone who will return hardware to the Mac, despite what is the registry fixed? Ideally I would like a solution that works on XP.
Thanks in advance!
My guess is that in the linked codeguru article, the Mintport solution is likely to exceed the problem you described. Although it is painful for implementation, I think the reason is that I have used the GetAdaptersInfo solution before, and it has been seen that when the adapter is added, the MAC address will be changed without rebooting, e.g. A Bluetooth adapter that provides PAN services
Instead of rebooting after changing the registry setting, you can try to stop and restart realwat network services.
(All the above assumptions are NB. If you try it and it works, then maybe you can add a post to those people who are trying future).
Comments
Post a Comment