- Home /
Question by
Pflegeleichtt · Jul 14, 2011 at 03:13 PM ·
macapple
Mac adress detection
Hi how can i detect in unity the MAC adress of an Apple Mac?
in windows i used this one :
using UnityEngine;
using System.Collections;
using System.Net.NetworkInformation;
using System;
public class NetworkInfo {
public static string PhysicalAddress = "";
public static void DisplayTypeAndAddress()
{
//IPGlobalProperties computerProperties = IPGlobalProperties.GetIPGlobalProperties();
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
Debug.Log(nics.Length + " nics");
//Debug.Log("Interface information for "+computerProperties.HostName+"."+computerProperties.DomainName);
PhysicalAddress = nics[0].GetPhysicalAddress().ToString();
Debug.Log(PhysicalAddress);
foreach (NetworkInterface adapter in nics)
{
IPInterfaceProperties properties = adapter.GetIPProperties();
/* Debug.Log(adapter.Description);
Debug.Log(String.Empty.PadLeft(adapter.Description.Length, '='));
Debug.Log(" Interface type .......................... : " + adapter.NetworkInterfaceType);
Debug.Log(" Physical Address ........................ : " + adapter.GetPhysicalAddress().ToString());
Debug.Log(" Is receive only.......................... : " + adapter.IsReceiveOnly);
Debug.Log(" Multicast................................ : " + adapter.SupportsMulticast);*/
}
}
}
Are there any alternatives and solutions?
Comment
nope, but i prefer showing flag when i meet fellow germans on this board :P not trying to offend any1 here ^.^
also, why would i bump a question for someone else
I'm simply saying that bumping is the effect. I'm thinking of changing my ID to Ordnung$$anonymous$$ussSein.
Best Answer
Answer by Waz · Jul 15, 2011 at 08:05 AM
It's .NET. If that doesn't work, it's a bug/limitation in Mono.