使用 C# 识别 CPU 架构类型 [英] Identifying the CPU architecture type using C#

查看:23
本文介绍了使用 C# 识别 CPU 架构类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想查看用户运行的是哪个CPU架构,是不是i386 或 X64 或 AMD64.我想在 C# 中做到这一点.我知道我可以尝试 WMI 或注册表.除了这两个还有别的办法吗?我的项目面向 .NET 2.0!

I want to check which CPU architecture is the user running, is it i386 or X64 or AMD64. I want to do it in C#. I know i can try WMI or Registry. Is there any other way apart from these two? My project targets .NET 2.0!

推荐答案

你也可以试试(只有在没有被操作的情况下才有效):

You could also try (only works if it's not manipulated):

System.Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE")

这篇关于使用 C# 识别 CPU 架构类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆