unity获取机器唯一标识符

1.SystemInfo类

Debug.Log(SystemInfo.graphicsDeviceID);//获取显卡的唯一标识符
Debug.Log(SystemInfo.deviceUniqueIdentifier);//获取设备唯一标识符
Debug.Log(SystemInfo.deviceType);//获取设备的类型
Debug.Log(SystemInfo.processorType);//获取处理器的类型

2.PC

using System.Net.NetworkInformation;
 private static string GetMacAddress()
    {
        string physicalAddress = "";
 
        NetworkInterface[] nice = NetworkInterface.GetAllNetworkInterfaces();
 
        foreach (NetworkInterface adaper in nice)
        {
 
            
 
            if (adaper.Description == "en0")
            {
                physicalAddress = adaper.GetPhysicalAddress().ToString();
                break;
            }
            else
            {
                physicalAddress = adaper.GetPhysicalAddress().ToString();
 
                if (physicalAddress != "")
                {
                    break;
                };
            }
        }
 
        return physicalAddress;
    }
上一篇:win10系统systeminfo命令的过滤用法


下一篇:内网探测 工作组信息收集