Easiest way to get main MAC address
A simple function to get PC's MAC address
Rate Easiest way to get main MAC address
(3(3 Vote))
Private Function GetMACAddress() As String
Dim Devices As Object
Dim Device As Object
Dim Temp As Variant
Dim Info As String
Set Devices = GetObject("winmgmts:").InstancesOf("Win32_NetworkAdapter")
For Each Device In Devices
For Each Temp In Device.Properties_
If Temp.Name = "MACAddress" Then GetMACAddress = CStr(Temp): Exit Function
Next
Next Device
End Function
Easiest way to get main MAC address Comments
No comments yet — be the first to post one!
Post a Comment