using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Management;
using System.Net.NetworkInformation;
using System.IO;
public string GETMAC()
{
string macadd = "";
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
PhysicalAddress address = nics[0].GetPhysicalAddress();
byte[] bytes = address.GetAddressBytes();
for (int i = 0; i < bytes.Length; i++)
{
macadd += bytes[i].ToString("X2");
if (i != bytes.Length - 1)
{
macadd += ":";
}
}
return macadd;
}