WIN7 64位支不支持WMI
Dim MyMacDim k
Set MyMac = GetObject("Winmgmts:").InstancesOf("Win32_NetworkAdapterConfiguration")
For Each MO In MyMac
If MO.IPEnabled = True Then
k = MO.MACAddress
Exit For
End If
Next
k = Mid(k, 1, 2) & Mid(k, 4, 2) & Mid(k, 7, 2) & Mid(k, 10, 2) & Mid(k, 13, 2) & Mid(k, 16, 2)
這段代碼在XP下沒問題,在WIN7 64位的系統下,不報錯,K值返回空