c++ 通过Socket获取本机Mac地址
int getMac(char* mac){
int sockfd;
struct ifreq tmp;
char macAddr[30];
sockfd=socket(AF_INET,SOCK_STREAM,0);
if(sockfd<0){
cout<<"create socket fail"<<endl;
return -1;
}
...
转载
2018-11-27 12:03:18 ·
1609 阅读 ·
0 评论