zoukankan      html  css  js  c++  java
  • SystemInfo获取设备系统参数

    using UnityEngine;
    using System.Collections;
    using System.Collections.Generic;
    publicclassGameControllerScript:MonoBehaviour
    {
    //指定输出文本框
    publicUnityEngine.UI.Text messageText;
    //存储临时字符串
    System.Text.StringBuilder info =newSystem.Text.StringBuilder();
    // Use this for initialization
    voidStart()
    {
    //将输出文本框置空
    messageText.text ="";
    info.AppendLine("设备与系统信息:");
    //设备的模型
    GetMessage("设备模型",SystemInfo.deviceModel);
    //设备的名称
    GetMessage("设备名称",SystemInfo.deviceName);
    //设备的类型
    GetMessage("设备类型(PC电脑,掌上型)",SystemInfo.deviceType.ToString());
    //系统内存大小
    GetMessage("系统内存大小MB",SystemInfo.systemMemorySize.ToString());
    //操作系统
    GetMessage("操作系统",SystemInfo.operatingSystem);
    //设备的唯一标识符
    GetMessage("设备唯一标识符",SystemInfo.deviceUniqueIdentifier);
    //显卡设备标识ID
    GetMessage("显卡ID",SystemInfo.graphicsDeviceID.ToString());
    //显卡名称
    GetMessage("显卡名称",SystemInfo.graphicsDeviceName);
    //显卡类型
    GetMessage("显卡类型",SystemInfo.graphicsDeviceType.ToString());
    //显卡供应商
    GetMessage("显卡供应商",SystemInfo.graphicsDeviceVendor);
    //显卡供应唯一ID
    GetMessage("显卡供应唯一ID",SystemInfo.graphicsDeviceVendorID.ToString());
    //显卡版本号
    GetMessage("显卡版本号",SystemInfo.graphicsDeviceVersion);
    //显卡内存大小
    GetMessage("显存大小MB",SystemInfo.graphicsMemorySize.ToString());
    //显卡是否支持多线程渲染
    GetMessage("显卡是否支持多线程渲染",SystemInfo.graphicsMultiThreaded.ToString());
    //支持的渲染目标数量
    GetMessage("支持的渲染目标数量",SystemInfo.supportedRenderTargetCount.ToString());
    //输出
    messageText.text = info.ToString();
    }
    // Update is called once per frame
    voidUpdate()
    {
    //退出
    if(Input.GetKeyUp("escape"))
    {
    if(Input.GetKeyUp("escape"))
    {
    Application.Quit();
    }
    }
    }
    voidGetMessage(paramsstring[] str)
    {
    if(str.Length==2)
    {
    info.AppendLine(str[0]+":"+ str[1]);
    }
    }
    }
     





  • 相关阅读:
    用Python随机生成一个六位验证码(验证码由数字和字母组成(大小写字母))
    0.4 uwsgi和nginx部署常见问题及解决
    Android小笔记
    Android之背景透明度
    Android开发中的错误总结
    Android “再按一次退出“
    java数组对象的复制
    Android之OpenCv
    学习资料
    Android常用正则表达式
  • 原文地址:https://www.cnblogs.com/caymanlu/p/6023272.html
Copyright © 2011-2022 走看看