用ioctl控制,通过SIOCGIFHWADDR获取MAC地址,SIOCSIFHWADDR设置MAC地址,不过在设 置MAC地址之前,要先把网卡down掉,设置好了以后,再UP起来. #include <sys/types.h> /* for socket(2) and related bits and pieces */ #include <sys/socket.h> /* for socket(2) */ #include <net/if.h> /* for str…
近期有个需求,需要获取客户端Mac地址作为白名单验证的依据.使用.net,B/S架构.先百度找了一些获取mac地址的方法, using System; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; using System.IO; using System.Net; using System.Configuration; using System.Web; us…