如何知道操作系统是32位还是64位 [英] how to know whether the OS is 32 bit or 64 bit

查看:141
本文介绍了如何知道操作系统是32位还是64位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


任何人都可以告诉我"如何在安装操作系统后知道操作系统是32位还是64位?"

解决方案

如果您检查将告诉您的IntPtr.Size。如果值为4则为32位OS,值为8则为64位。


 bool is64Bit = false; 
if(IntPtr.Size == 8)
is64Bit = true;






 bool is64Bit = false; 
if(Environment.GetEnvironmentVariable(" PROCESSOR_ARCHITECTURE")。ToString()。Contains(" 64"))
is64Bit = true;



有很多方法可以确定这一点。这只是2.查看此链接

http://channel9.msdn.com/forums/TechOff/410567-C-Detect-32-bit-or-64-bit-OS/


hi everybody,

could anybody please tell me "how to know whether the OS is 32 bit or 64 bit after installing the OS???"

解决方案

If you check the IntPtr.Size that will tell you.  for a value of 4 then it is a 32 bit OS, for a value of 8 then it is 64 bit.

bool is64Bit = false;
if(IntPtr.Size==8)
   is64Bit = true;


or

bool is64Bit = false;
if(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE").ToString().Contains("64"))
     is64Bit = true;

There are many ways to determine this.  This is just 2.  Check out this link

http://channel9.msdn.com/forums/TechOff/410567-C-Detect-32-bit-or-64-bit-OS/


这篇关于如何知道操作系统是32位还是64位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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