c# 读取网卡Mac
///<summary> /// 通过NetworkInterface读取网卡Mac ///</summary> ///<returns></returns> public static string GetMacByNetworkInterface() { List<string> macs = new List<string>(); NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces(); return interfaces.Where(p => p.OperationalStatus == OperationalStatus.Up).FirstOrDefault().GetPhysicalAddress().ToString(); }