How do I tell if my application is running as a 32-bit or 64-bit application?

后端 未结 5 1048
情歌与酒
情歌与酒 2020-11-29 02:07

How do I tell if my application (compiled in Visual Studio 2008 as Any CPU) is running as a 32-bit or 64-bit application?

5条回答
  •  攒了一身酷
    2020-11-29 02:55

    if (IntPtr.Size == 8) 
    {
        // 64 bit machine
    } 
    else if (IntPtr.Size == 4) 
    {
        // 32 bit machine
    }
    

提交回复
热议问题