I\'d like to be able to read the mac address from the first active network adapter using VB.net or C# (using .NET 3.5 SP1) for a winform application
It looks like this is an old post but I know that you will run into this thread looking for help so here is what I did today to get the MAC addresses of all the network interfaces in my Laptop.
First of all you have to import the following
Imports System.Net.NetworkInformation
This is the function that returns all the MAC addresses in an string array
Private Function GetMAC() As String()
Dim MACAddresses(0) As String
Dim i As Integer = 0
Dim NIC As NetworkInterface
For Each NIC In NetworkInterface.GetAllNetworkInterfaces
ReDim Preserve MACAddresses(i)
MACAddresses(i) = String.Format("{0}", NIC.GetPhysicalAddress())
i += 1
Next
Return MACAddresses
End Function