You can use WMI (from the System.Management namespace) to get the MAC
address(es) (see below).
Regards,
Martin Bischoff
-----------
using System;
using System.Management;
class Sample_ManagementObjectSearcher
{
public static int Main(string[] args)
{
ManagementObjectSearcher searcher = new
ManagementObjectSearcher("select * from win32_networkadapter");
foreach (ManagementObject adapter in searcher.Get())
{
Console.WriteLine("Adapter Name: " + adapter["name"]);
Console.WriteLine("Adapter Type: " + adapter["AdapterType"]);
Console.WriteLine("MAC Address: " + adapter["MACAddress"]);
Console.WriteLine("\n");
}
return 0;
}
}
-----------
Roman said:
How can I get the MAC address from the network interface card? Is there a
class in the .NET framework that does the job? I wasn't able to find
anything.
Thanks,
Roman Sallin