unity获取机器唯一标识符

2021/5/21 10:29:48

本文主要是介绍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;
    }


这篇关于unity获取机器唯一标识符的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程