how to get the MAC address of client?
I have a client server program using UPD created in MFC. In the server there are two listboxes. The first one displays the ip addresses of the connected clients.
I want the second listbox to display the MAC address when i click the ip address from the listbox.
So how can I get the MAC address of the client by clicking the ip address in the first listbox?
so i used this code to get the MAC address:
the code above just provides the currents computer mac address so it doesn't matter which ip address i click in the listbox because it only displays the same mac address
IP_ADAPTER_INFO AdapterInfo; // Allocate information for up to 16 NICs
DWORD dwBufLen = sizeof(AdapterInfo); // Save the memory size of buffer
DWORD dwStatus = GetAdaptersInfo( // Call GetAdapterInfo
AdapterInfo, // [out] buffer to receive data
&dwBufLen); // [in] size of receive data buffer
assert(dwStatus == ERROR_SUCCESS); // Verify return value is valid, no buffer overflow
PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo;// Contains pointer to current adapter info
PrintMACaddress(pAdapterInfo->Address); // Print MAC address
pAdapterInfo = pAdapterInfo->Next; // Progress through linked list
while(pAdapterInfo); // Terminate if last adapter
can someone please provide some code to do this