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?
if (IntPtr.Size == 8) { // 64 bit machine } else if (IntPtr.Size == 4) { // 32 bit machine }