Topic: Facing error
Imports System.Management
Imports System.Management.Instrumentation
Dim searcher As New ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration where IPEnabled=true")
Dim objects As IEnumerable(Of ManagementObject) = searcher.[Get]().Cast(Of ManagementObject)()
Dim mac As String = (From o In objectsOrder By o("IPConnectionMetric")o("MACAddress").ToString()).FirstOrDefault()
lblMacId.Text = mac
Author: PADMAKEECHU
PARTH
Add the System.Management dll reference to the project.
Right click on Solution Explorer -> Add Reference
Under the .Net tab select System.Management and click OK.
Then add the namespace as shown below -
Imports System.Management