一获取mac地址 1.先添加system.management的dll组件2.添加引用 public string GetMACAddress(){string MoAddress = "";ManagementObjectSearcher query = new ManagementObjectSearcher("select * from Win32_NetworkAdapterConfiguration");ManagementObjectCollection…
这是获取网卡的硬件地址的代码,如果无法编译通过,记得把下面的这几个头文件加上把. #include <sys/socket.h> // Per msqr#include <sys/sysctl.h>#include <net/if.h>#include <net/if_dl.h> #pragma mark MAC addy// Return the local MAC addy// Courtesy of FreeBSD hackers email list…