获取设备名称


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
public sealed class EncryptUtil
{
        public static string Md5( string value)
       {
               if ( string .IsNullOrEmpty(value))
              {
                      return null ;
              }
               //获取运营商
              System.Security.Cryptography. MD5 md5 = new System.Security.Cryptography. MD5CryptoServiceProvider ();
               //                     计算机列表
               byte [] bytResult = md5.ComputeHash(System.Text. Encoding .Default.GetBytes(value));
               string strResult = BitConverter .ToString(bytResult);
               //                     替换
              strResult = strResult.Replace( "-" , "" );
               return strResult;
       }
}




using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DeviceUtil
{
        /// <summary>
        /// 设备标识符
        /// </summary>
        public static string DeviceIdentifier
       {
               get
              { //一个独特的设备标识符。它保证每一个设备都是独一无二的(只读
                      return SystemInfo .deviceUniqueIdentifier;
              }
       }
        /// <summary>
        /// 获取设备型号
        /// </summary>
        public static string DeviceModel
       {
               get
              {
#if UNITY_IPHONE && !UNITY_EDITOR
            return Device.generation.ToString();
#else          //设备的模型(只读)。
                      return SystemInfo .deviceModel;
#endif
              }
       }
}

猜你喜欢

转载自blog.csdn.net/Pandora12138/article/details/80998060