如何获取本机MAC地址
struct ifreq ifr; int fd; fd=socket(AF_INET,SOCK_DGRAM,0); strcpy(ifr.ifr_name,"eth0"); ifr.ifr_addr.sa_family=AF_INET; ioctl(fd,SIOCGIFHWADDR,&ifr); puts(ifr.ifr_hwaddr.sa_data);
相关推荐
OwenJi 2020-06-01
qscool 2020-05-10
jackalwb 2020-02-11
KilluaZoldyck 2020-01-06
alwayshelloworld 2013-06-30
cmsmdn 2019-12-17
小仙儿 2019-12-01
PHP恶魔笔记 2019-11-21
xuyunti 2019-11-05
mingmingini 2011-03-06
Scorpionbao 2011-03-06
hickwu 2011-02-18
过儿古墓 2011-01-14
linuxisperfect 2010-12-12
xz0mzq 2011-09-02
柯利南 2011-04-16
lianweikj0 2019-11-04
NameCHC 2019-10-29