/// <summary> /// 获取当前操作系统类型,例如:x64-based或x86-based /// </summary> /// <returns></returns> public static string GetSystemType() { //打开对应的WMI实例 ManagementClass system = OpenWMIClass("win32_computersystem"); //将WMI信息绑定到WMI实例 system.Get(); //获取WMI信息中名为systemtype的属性的值 string result = system.GetPropertyValue("systemtype").ToString(); //手动释放资源 ReleaseResource(system); return(result); }