C# - Environment.Is64BitProcess Property with Example

In this tutorial, we will learn about the C# Environment.Is64BitProcess property with its definition, usage, syntax, and example. By Nidhi Last updated : March 30, 2023

Environment.Is64BitProcess Property

The Environment.Is64BitProcess property returns a boolean value, if the current process is a 64-bit process then it returns true, otherwise it returns false.

Syntax

bool Environment.Is64BitProcess

Parameter(s)

  • None

Return Value

Returns a 'bool' value.

C# Example of Environment.Is64BitProcess Property

The source code to check whether running process is 64-bit process or not using Environment class is given below. The given program is compiled and executed successfully.

using System;

class Sample
{
    //Entry point of Program
    static public void Main()
    {
        bool isBit64Process = false;

        isBit64Process = Environment.Is64BitProcess;

        if (isBit64Process == true)
            Console.WriteLine("Current Process is 64 bit process");
        else
            Console.WriteLine("Current Process is not 64 bit process");
    }
}

Output

Current Process is not 64 bit process
Press any key to continue . . .

C# Environment Class Programs »





Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.