代码如下:

 1 //获得网卡序列号
 2 //MAc地址 http://www.cnblogs.com/sosoft/
 3     public string GetMoAddress()
 4     {
 5         string MoAddress = " ";
 6         ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
 7         ManagementObjectCollection moc2 = mc.GetInstances();
 8         foreach (ManagementObject mo in moc2)
 9         {
10             if ((bool)mo["IPEnabled"] == true)
11                 MoAddress = mo["MacAddress"].ToString();
12             mo.Dispose();
13         }
14         return MoAddress.ToString();
15     }

 

相关文章:

  • 2021-06-13
  • 2021-08-19
  • 2021-12-14
  • 2022-12-23
  • 2022-02-12
猜你喜欢
  • 2022-12-23
  • 2022-01-19
  • 2021-10-11
  • 2021-07-07
相关资源
相似解决方案