in Visual C# 2010 express what is the most reliable way to detect windows OS Architecture (x86,x64)

Posted by NightsEvil on Stack Overflow See other posts from Stack Overflow or by NightsEvil
Published on 2010-06-01T06:12:40Z Indexed on 2010/06/01 6:33 UTC
Read the original article Hit count: 217

Filed under:

i am using Visual C# 2010 express and i need the most reliable way (on button click) and in .NET 2.0 framework to detect if windows is currently x86 or x64 in a message box.. up till now i have been using this code but i need to know if there is a more accurate way?

        string target = @"C:\Windows\SysWow64";
        {
            if (Directory.Exists(target))
            {
               MessageBox.Show("x64");
            }
            else
            {
               MessageBox.Show("x86");
            }

© Stack Overflow or respective owner

Related posts about c#