-1

正是标题所暗示的:

如何获取使用 Visual C++ 运行程序的计算机的 MAC 地址?

我有:

getManagerHostMAC.obj : error LNK2019: unresolved external symbol _GetAdaptersInfo@8  

具有提供的功能:获取机器的MAC地址 - 好的解决方案?

4

2 回答 2

2

The Win32 GetAdaptersInfo() and GetAdaptersAddresses() functions both return MAC addresses, amongst other things. Remember that a machine may have multiple network adapters installed, thus have multiple MAC addresses available.

于 2013-06-27T09:12:24.160 回答
1

You need to link with Iphlpapi.lib. In Visual Studio, just add it to the list of linker libraries in the Project Properties dialog.

于 2013-06-27T09:22:37.440 回答