Skip to content

Instantly share code, notes, and snippets.

@sholfen
Created November 13, 2013 09:51
Show Gist options
  • Save sholfen/7446448 to your computer and use it in GitHub Desktop.
Save sholfen/7446448 to your computer and use it in GitHub Desktop.
you can use this code to check OS is 64 bit or 32 bit.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
bool blIs64BitOS = Environment.Is64BitOperatingSystem;
if (blIs64BitOS)
Console.WriteLine("This is a 64bit OS");
else
Console.WriteLine("This is a 32bit OS");
bool blIs64BitProcess = Environment.Is64BitProcess;
if (blIs64BitProcess)
Console.WriteLine("This is a 64bit process");
else
Console.WriteLine("This is a 32bit process");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment