使用monotouch获取IPAD 2的Mac地址

Hâl*_*maz 1 c# macos xamarin.ios ios

  foreach (var netInterface in NetworkInterface.GetAllNetworkInterfaces()) 
  {

     if (netInterface.NetworkInterfaceType == NetworkInterfaceType.Wireless80211) 
      {
       var address = netInterface.GetPhysicalAddress();
       string c=  BitConverter.ToString(address.GetAddressBytes());

        }
 }
Run Code Online (Sandbox Code Playgroud)

我的iPad显示像020000000输出,但我的模拟器显示正确,有问题吗?

Kru*_*lur 5

在iOS7中不再可以获取MAC地址.

Apple将此功能与获取设备唯一ID的功能结合在一起.

您可以在此处找到相关信息.

还有供应商ID或广告ID等替代品.但是,这些100%都没有替换以前真正唯一的ID.请参阅Apple的文档.