Hey, I have found this code to get a MAC address, but it returns a long string and doesn't include ':'.
Is it possible to add in the ':' or split up the string and add it it myself?
here is the code:
private object GetMACAddress()
{
string macAddresses = "";
foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
{
if (nic.OperationalStatus == OperationalStatus.Up)
{
macAddresses += nic.GetPhysicalAddress().ToString();
break;
}
}
return macAddresses;
}
It returns the value of 00E0EE00EE00 whereas I want it to display something like 00:E0:EE:00:EE:00.
Any ideas?
Thanks.