.NET Framework Bookmark and Share   
 index > 64-Bit .NET Framework Development > how to know whether the OS is 32 bit or 64 bit
 

how to know whether the OS is 32 bit or 64 bit

hi everybody,

could anybody please tell me "how to know whether the OS is 32 bit or 64 bit after installing the OS???"

kranthi shankar koncha
If you check the IntPtr.Size that will tell you. for a value of 4 then it is a 32 bit OS, for a value of 8 then it is 64 bit.

bool is64Bit = false;
if(IntPtr.Size==8)
   is64Bit = true;



or

bool is64Bit = false;
if(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE").ToString().Contains("64"))
     is64Bit = true;

There are many ways to determine this. This is just 2. Check out this link

http://channel9.msdn.com/forums/TechOff/410567-C-Detect-32-bit-or-64-bit-OS/


Joshua Bylotas
http://www.ivorymatter.com

Joshua Bylotas
After installing the OS? Look at the box that the disk came in.

Hans Passant.
nobugz

You can use google to search for other answers

Custom Search

More Threads

• What's the different between 64-bit and 32-bit ?
• Lacking HID device support under Vista? Bizarre structure alignment after Marshal.PtrToStructure? What is going on here??
• (2005) visual studio has encountered a problem and needs to close
• A testing environment for testing 64bit program
• RSACryptoServiceProvider FatalExecutionEngineError in Vista 64
• Reading access(X86) and writing to oracle(X64) from the same app on an X64 machine?
• Developing our app for 64-bit on a 32-bit OS
• Very slow to put breakpoints on 32bit Apps
• How do I install a 64-bit COM+ component using MSI (WiX)
• How to Iterate through a collection in a VB.NET program ?