SystemInfo获取设备系统参数

摘要:
使用UnityEngine;使用系统。收藏;使用System.Collections。通用的PublicclassGameControllerScript:MonoBehavior{//指定输出文本框publicUnityEngine.UI.TextmessageText;//存储临时字符串System.text.StringBuilderi
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]);
}
}
}
SystemInfo获取设备系统参数第1张
 



来自为知笔记(Wiz)



免责声明:文章转载自《SystemInfo获取设备系统参数》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇函数总结vue 高德地图 地图初始化显示接口返回的多个经纬度下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

C#访问Java的WebService添加SOAPHeader验证的问题

这两天做与公司OA的接口,发现C#访问Java的WebService需要提供一个SOAP的头验证信息,但是WebService的WSDL中并没有提供约定的验证信息,所以Visual Studio生成的代理类并没有发现这些内容,所以这个SOAPHeader就必须要自己组织,还遇到一个问题就是SOAP头部信息,OA那边还按照不知道什么实例添加了一个根节点没有的...

关于OPC自动化接口编程(OPCDAAuto.dll)几点注意问题

为了能够在工作中方便的应用OPC和充分的理解OPC的开发流程、内部机制,这两天正在研究开发OPC客户端程序,一般我们开发OPC客户端程序有以下几种方式: (1)       使用OPCNetAPI,需要用到OPCNetAPI.dll,OPCNetAPI.Com.dll (2)       使用自动化接口,需要用到OPCDAAuto.dll (3)     ...

修改 android的 开机 音乐

接 修改动画 的 教程, 接下来我们给系统添加开机声音 由于动画是在BootAnimation播放的,所以我们的声音肯定也在这个类中做,照猫画虎 首先在BootAnimation.h添加方法的声明和头文件的引用 #include <media/AudioSystem.h>#include <media/mediaplayer.h>...

如何优雅的在java中统计代码块耗时

如何优雅的在java中统计代码块耗时 在我们的实际开发中,多多少少会遇到统计一段代码片段的耗时的情况,我们一般的写法如下 long start = System.currentTimeMillis(); try { // .... 具体的代码段 } finally { System.out.println("cost: " + (Syste...

WkHtmlToPdf 生成 PDF

1. 首先去http://wkhtmltopdf.org/downloads.html 下载最新版本的安装包 2. 执行安装完成 3. CMD 命令行运行wkhtmltopdf.exe程序生成PDF C:Program Fileswkhtmltopdfin>wkhtmltopdf.exe --orientation Landscape --javas...

关于toString的自动调用

1 class a{ 2 3 } 4 5 class b extends a{ 6 7 String rr = "zzz"; 8 9 public String toString(){ 10 11 return "aa"; 12 13 } 14 15 }...