判断某程序是64位还是32位(转)

判断某程序是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位)
 
 
原文地址:https://www.cnblogs.com/smailxiaobai/p/2318398.html