如何判断我的应用程序(在Visual Studio2008中作为任何CPU编译)是作为32位应用程序运行还是作为64位应用程序运行?
发布于 2008-12-29 13:09:51
if (IntPtr.Size == 8)
{
// 64 bit machine
}
else if (IntPtr.Size == 4)
{
// 32 bit machine
}
发布于 2010-08-12 02:25:33
发布于 2008-11-05 18:09:06
我在Martijn Boven中找到了这段代码,它可以做到这一点:
public static bool Is64BitMode() {
return System.Runtime.InteropServices.Marshal.SizeOf(typeof(IntPtr)) == 8;
}
https://stackoverflow.com/questions/266082
复制相似问题