MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.
Friend Function GetMACAddress() As String Dim mc As ManagementClass = New ManagementClass("Win32_NetworkAdapterConfiguration") Dim moc As ManagementObjectCollection = mc.GetInstances() Dim MACAddress As String = String.Empty For Each mo As ManagementObject In moc If (MACAddress.Equals(String.Empty)) Then If CBool(mo("IPEnabled")) Then MACAddress = mo("MacAddress").ToString() mo.Dispose() End If MACAddress = MACAddress.Replace(":", String.Empty) Next Return MACAddress End Function