如何检查操作系统是 32 位操作系统还是 64 位 [英] How to check if OS is 32 Bit OS or 64 Bit
问题描述
是否可以使用 vb.net 代码检查计算机是 32 位还是 64 位?我只想在消息中显示结果.
Is it possible to check if computer is 32 bit or 64 using vb.net code? I just want to display the result in a message.
请指教.
推荐答案
Environment.Is64BitOperatingSystem
应该做得很好.
Environment.Is64BitOperatingSystem
should do nicely.
确定当前操作系统是否为 64 位操作系统.
Determines whether the current operating system is a 64-bit operating system.
假设错误表示 32 位环境.
The assumption being that a false signifies a 32bit environment.
如果您想确定进程是否为 64 位(因为您可以在 64 位操作系统上运行 32 位进程),请使用 Environment.Is64BitProcess:
If you want to find out if the process is 64bit (as you can run a 32bit process on a 64bit OS), use Environment.Is64BitProcess:
确定当前进程是否为 64 位进程.
Determines whether the current process is a 64-bit process.
<小时>
这两者都已在 .NET 4.0 中引入.
Both of these have been introduced in .NET 4.0.
这篇关于如何检查操作系统是 32 位操作系统还是 64 位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!