判断某程序是64位还是32位

1. 用代码判断本身
if (IntPtr.Size == 4)
{
    // 32-bit
}
else if (IntPtr.Size == 8)
{
    // 64-bit
}
2. 用代码判断正在运行的其他进程
 
 
If you have a hex editor program, just open your file with it and shortly after the standard header intro stuff (like "This program cannot be run in DOS mode...") you will see either
 
"PE..L" (hex code: 504500004C) = 32 bit
or
"PE..d†" (hex code: 504500006486) = 64 bit
 
其实普通文本编辑器就行(比如notepad),打开之后搜索PE就会得到类似下面的结果
(64位)
(32位)
 




posted @ 2012-01-10 17:04  队长  阅读(1159)  评论(0编辑  收藏  举报