Board index » cppbuilder » MAC address of network adapter
Berlani
![]() CBuilder Developer |
Berlani
![]() CBuilder Developer |
MAC address of network adapter2005-08-14 08:33:54 PM cppbuilder82 Hello, Is anybody could tell me how to find the Unique MAC Adresse of the installed Network boards. Thanks in advance JC.Berlani |
Stefano Frosio
![]() CBuilder Developer |
2005-08-14 11:58:39 PM
Re:MAC address of network adapterQuoteIs anybody could tell me how to find the Unique MAC ========================== Stefano Frosio www.esse-effe.com ========================== |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2005-08-15 03:36:35 AM
Re:MAC address of network adapter
"Stefano Frosio" < XXXX@XXXXX.COM >wrote in
message news: XXXX@XXXXX.COM ... QuoteHere you go: Address member that is the MAC address. Gambit {smallsort} |
Vladimir Stefanovic
![]() CBuilder Developer |
2005-08-15 05:23:01 AM
Re:MAC address of network adapter
Yes, I use that method also.
But if it is the question of getting the *unique* hardware ID based on MAC, than I think that the string: "444553540000" ... that sometimes can be returned should be skipped. It has something with modems and dial-up (PPP). -- Best regards, Vladimir Stefanovic "Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message Quote
|
Mike Collins
![]() CBuilder Developer |
2005-08-15 06:13:21 AM
Re:MAC address of network adapter
GetAdaptersInfo() returns info on all types of network adapters, that
includes, loop-back, NIC, modems, dial-up's and VPN. If your looking for the NIC then you need to examine the value of IP_ADAPTER_INFO.Type. "Vladimir Stefanovic" < XXXX@XXXXX.COM >wrote in message QuoteYes, I use that method also. |
Berlani
![]() CBuilder Developer |
2005-08-15 03:44:06 PM
Re:MAC address of network adapter
Hello,
Thanks for your answer. I already write a program which use the function GetAdaptersInfo() and I used it on many computers. But on one new computer type which use Windows XP too, this function give me a wrong MAC address . Then I look on microsoft site at the following address : msdn.microsoft.com/library/default.asp and on the top of page there is: Windows Server 2003 and Windows XP: Use the GetAdaptersAddresses function instead of GetAdaptersInfo. I am interested to try this function but unfortunatly I do not find some declaration like PIP_ADAPTER_ADDRESSES and so on. Is anybody know where we can find this kind of files descriptions ? Thanks JC.Berlani My operating system is Windows XP "Stefano Frosio" < XXXX@XXXXX.COM >a écrit dans le message de news: XXXX@XXXXX.COM ... Quote>Is anybody could tell me how to find the Unique MAC |
Mike Collins
![]() CBuilder Developer |
2005-08-15 09:45:53 PM
Re:MAC address of network adapter
What do you mean the wrong MAC address? GetAdapterInfo() works fine on all
our machines using XP (home, professional, SP1, SP2) and Win2003. What does your code look like? As I mentioned before, GetAdapterInfo() can be used to return information on many different adapters, you need to examine the Type value of the IP_ADAPTER_INFO structure. Also, I have found that Windows does not always preserve the order in which your adapters appear in the list. "Berlani" < XXXX@XXXXX.COM >wrote in message QuoteHello, |
JF Jolin
![]() CBuilder Developer |
2005-08-16 03:59:46 AM
Re:MAC address of network adapter
Berlani < XXXX@XXXXX.COM >wrote:
QuoteI already write a program which use the function GetAdaptersInfo() and I printf("\tAdapter Addr: \t%ld\n", pAdapter->Address); With: printf("\tAdapter Addr: \t"); for (int i = 0; i < (int) pAdapter->AddressLength; i++) printf("%02X ", (BYTE) pAdapter->Address[i]); printf("\n"); The web site where i saw that adjustment is: www.voidnish.com/FreeTools.aspx -- JF Jolin |