vba获取本机网卡MAC地址的代码

Excel中通过VBA获取本机网卡的MAC地址

  
    Dim MyMac
    
  Set MyMac = GetObject("Winmgmts:").InstancesOf("Win32_NetworkAdapterConfiguration")
  
  For Each MyMacAddress In MyMac
  
   If MyMacAddress.IPEnabled = True Then
   
   MsgBox  本机网卡MAC地址是:MyMacAddress.MacAddress
   
  Exit For
  
  End If
  
  Next
  


本站数据来源于互联网,仅供个人学习交流,如有侵权,请联系我们进行删除

Copyright © 2020 - 2021 WXXBEST 蜀ICP备18009175号-1