C# 如何获取操作系统架构(x86 或 x64)?
可能的重复:
如何使用.net检测Windows 64位平台?
如何使用 .NET 2.0 检索操作系统架构(x86 或 x64)?
我在Google上还没有找到什么好的方法来获取操作系统架构。我发现的是如何判断进程是 32 位还是 64 位。
如果在 .NET 2.0 中找不到任何内容,请告诉我。 :)
Possible Duplicate:
How to detect Windows 64 bit platform with .net?
How can I retrieve the operating system architecture (x86 or x64) with .NET 2.0?
I have not found any good method to get the OS architecture on Google. What I found was how to tell whether the process is 32-bit or 64-bit.
If there isn't anyway to find out in .NET 2.0 please tell me. :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不是重复问题中接受的答案,但这就是我的做法:
使用 GetEnvironmentVariable 查找 PROCESSOR_ARCHITEW6432 变量。如果它不存在,则您必须运行 32 位:
Not the accepted answer in the duplicate question, but this is how I'd do it:
Use
GetEnvironmentVariable
to look for the PROCESSOR_ARCHITEW6432 variable. If it doesn't exist, you must be running 32bit: