Identifying the CPU architecture type using C#

Anirudh Goel picture Anirudh Goel · Apr 20, 2009 · Viewed 33.1k times · Source

I want to check which CPU architecture is the user running, is it i386 or X64 or AMD64. I want to do it in C#. I know i can try WMI or Registry. Is there any other way apart from these two? My project targets .NET 2.0!

Answer

Mehrdad Afshari picture Mehrdad Afshari · Apr 20, 2009

You could also try (only works if it's not manipulated):

System.Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE")