using UnityEngine;
using System.Collections;
using System.Net.NetworkInformation;
public class NetWorkInfo : MonoBehaviour
{
void Start ()
{
Debug.Log(GetMacAddress());
}
public static string GetMacAddress()
{
string physicalAddress = "";
NetworkInterface[] nice = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface adaper in nice)
{
Debug.Log(adaper.Description);
if (adaper.Description == "en0")
{
physicalAddress = adaper.GetPhysicalAddress().ToString();
break;
}
else
{
physicalAddress = adaper.GetPhysicalAddress().ToString();
if (physicalAddress != "")
{
break;
};
}
}
return physicalAddress;
}
}
获取ios设备mac地址
最新推荐文章于 2024-05-23 11:54:19 发布