Possible Duplicate:
How to detect Windows 64 bit platform with .net?
How can I retrieve the operating system architecture (x86 or x64) with .NET 2.0?
I have not found any good method to get the OS architecture on Google. What I found was how to tell whether the process is 32-bit or 64-bit.
If there isn't anyway to find out in .NET 2.0 please tell me. :)
Not the accepted answer in the duplicate question, but this is how I'd do it:
Use GetEnvironmentVariable
to look for the PROCESSOR_ARCHITEW6432 variable. If it doesn't exist, you must be running 32bit:
bool is64bit = !string.IsNullOrEmpty(
Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432"));
来源:https://stackoverflow.com/questions/3639129/c-sharp-how-do-you-get-the-operating-system-architecture-x86-or-x64