if (Environment.Is64BitOperatingSystem) {
    Console.WriteLine("64 位系统");
} else {
    Console.WriteLine("32 位系统");
}