发表评论
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。
Function CareFGetMac() As String
Try
Dim Mac As String
Dim mc As ManagementClass
mc = New ManagementClass("Win32_NetworkAdapterConfiguration")
Dim Moc2 As ManagementObjectCollection = mc.GetInstances
Dim mo As ManagementObject
For Each mo In Moc2
If CBool(mo("IPEnabled")) = True Then
Mac += mo("MacAddress").ToString + "@"
Mac = mo("MacAddress").ToString
End If
'Mac = mo("MacAddress").ToString
Next
mo.Dispose()
mc.Dispose()
Moc2.Dispose()
CareFGetMac = Mac
Catch ex As Exception
CareFGetMac = "00:E0:4C:77:1F:4A"
End Try
End Function
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。