如何检测32/64平台? [英] How to detect 32/64 platform?

查看:35
本文介绍了如何检测32/64平台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要检测应用程序是否在 Win32/64 上运行.

I need to detect if the app is running on Win32/64.

更新:人员报告说依赖 [HKLMHARDWAREDESCRIPTIONSystemCentralProcessor] 键不是一个好主意.

Update: People are reporting that relying on the [HKLMHARDWAREDESCRIPTIONSystemCentralProcessor] key is not a good idea.

推荐答案

您在问题中提供的代码有一些问题,但它确实可以正常工作.我怀疑您实际上并没有运行该代码,并且犯了错误并以某种方式发布了错误的代码.

The code that you present in the question has a few wrinkles, but it does work correctly. I suspect that you are not actually running that code, and have made an error and somehow posted the wrong code.

FWIW,您应该使用 中的 TOSVersionSystem.SysUtils 用于检查底层平台的位数.TOSVersion.Architecture 属性会告诉您是否底层平台为32位或64位.

FWIW, you should use TOSVersion from System.SysUtils to check the bitness of the underlying platform. The TOSVersion.Architecture property will tell you whether or not the underlying platform is 32 or 64 bit.

这篇关于如何检测32/64平台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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