判断某程序是64位还是32位
生活随笔
收集整理的這篇文章主要介紹了
判断某程序是64位还是32位
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1. 用代碼判斷本身 if (IntPtr.Size == 4) { // 32-bit } else if (IntPtr.Size == 8) { // 64-bit } 2. 用代碼判斷正在運行的其他進程 http://stackoverflow.com/questions/1953377/how-to-know-a-process-is-32-bit-or-64-bit-programmatically 3. 不用代碼判斷任意exe,看第二個回復 http://blogs.technet.com/b/windowshpc/archive/2009/03/27/how-to-tell-if-a-exe-file-is-a-32-bit-or-64-bit-application-using-dumpbin.aspx 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位)
總結
以上是生活随笔為你收集整理的判断某程序是64位还是32位的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用VS2012内建的C++测试架构进行
- 下一篇: UNIX网络编程 卷2 源代码使用