1. 程式人生 > >判斷某程式是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位)