I'm looking for a way to find in VB NET the MAC Address of the network card installed on the pc, I mean not VPN, not any other kind of virtual network adapter, just the MAC of the card inside the pc, even if it's disabled.
Please see the function I wrote below, now I just avoid the NetworkInterfaceType=Tunne
l, but how can I be sure to find the physical card? NetworkInterface type has so many values....
Public Function GetMacAddress() As String
Dim theNetworkInterfaces() As System.Net.NetworkInformation.NetworkInterface = System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()
Dim currentInterface As System.Net.NetworkInformation.NetworkInterface
For Each currentInterface In theNetworkInterfaces
If currentInterface.NetworkInterfaceType <> Net.NetworkInformation.NetworkInterfaceType.Tunnel Then
GetMacAddress = currentInterface.GetPhysicalAddress().ToString()