|
.NET 4.0在Environment類別新增Is64BitOperatingSystem與Is64BitProcess屬性,其功用分別為判斷當前作業系統是否為64位元版本,與判斷當前處理序是否為64位元。
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication4
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("64位元作業系統: {0}",Environment.Is64BitOperatingSystem);
- Console.WriteLine("64位元處理序: {0}", Environment.Is64BitProcess);
- }
- }
- }
复制代码
|
|