How to detect if 32-bit or 64-bit architecture in a WinForms application using C#

1 Answer

0 votes
namespace WinFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            bool is64Bit = Environment.Is64BitOperatingSystem;

            MessageBox.Show(is64Bit ? "64-bit OS" : "32-bit OS");
        }
    }
}


/*
run:
 
64-bit OS

*/

 



answered Jun 20 by avibootz
...