Is my C# code running in 64 bit version of windows?

Today a friend of mine asked me if there was an easy way to check if he was running in 32 or 64 bit version of windows. I’m still not sure on why he wanted to know that (I’m assuming he doesn’t belong to the small group of people that really needs this info), but the good news is that there are a couple of properties exposed by the Environment class which return that info: Is64BitOperatingSystem (true when running in a 64 bit operating system) and Is64BitProcess (true when running in a 64-bit process – ie, with access to a 64 bit address space). Notice that these are *new* properties introduced by the .NET 4.0 :,,)

Advertisements

~ by Luis Abreu on March 15, 2010.

One Response to “Is my C# code running in 64 bit version of windows?”

  1. If you”re not using .net 4.0, you can check here for the answer to that question):
    http://stackoverflow.com/questions/336633/how-to-detect-windows-64-bit-platform-with-net/681542#681542

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: