C# Program to Check if Operating System is 64-bit OS or Not Using Environment Class
Environment Class provides information about the current platform and manipulates, the current platform. It is useful for getting and setting various operating system-related information. We can use it in such a way that retrieves command-line arguments information, exit codes information, environment variable settings information, contents of the call stack information, and time since last system boot in milliseconds information. In this article, we will discuss how to check whether running operating systems is 64 bit OS or not using Environment class. So we need to use the Is64BitOperatingSystem property of the Environment class. This property is used to check whether the running operating system is based on 64-Bit architecture or not and returns true if it is 64-bit OS otherwise it will return false.
Return Type: The return type of this property is Boolean. It returns true if the OS is 64-bit OS. Otherwise, it will return false.
Operating System is based 64-bit architecture
When we run the same code in the 32-bit system then the output will be:
Operating System is not based 64-bit architecture
Please Login to comment...