Easiest way to get main MAC address
![Visual Basic 6, or VB Classic Visual Basic 6, or VB Classic](https://www.fortypoundhead.com//assets/img/icons/v7/vb6.png)
A simple function to get PC's MAC address
Original Author: Haytham Khalil
Code
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
Loading Comments ...
Comments
No comments have been added for this post.
You must be logged in to make a comment.