In .NET versions prior to .NET 4.0, in order to check wheter you were running in a 64 bit process or on a 64 bit operating system, you would have to use PInvoke calls or WMI. With the release of .NET 4.0, Microsoft has added two properties to the Environment class which will help you out; Is64BitOperatingSystem and Is64BitProcess
bool is64BitOS = Environment.Is64BitOperatingSystem;
bool is64BitProcess = Environment.Is64BitProcess;
Is64BitProcess might return false even though Is64BitOperatingSystem returns true, since the process may be a 32 bit process running on a 64 bit OS under WOW64.
Justin van Patten has a blog post about the new BCL features .NET 4.0. Read the entire blog post here.