本帖最后由 caozhy 于 2012-04-07 19:15:58 编辑

解决方案 »

  1.   

    刚刚写了篇博客来回答你这个问题:C# Tips: 通过WMI查询当前操作系统是64位的还是32位的 
    http://blog.csdn.net/xinyaping/article/details/7435840
        /// <summary>  
        /// Gets OS address width.  
        /// </summary>  
        /// <returns>32 indicates 32-bit OS, and 64 indicates 64-bit OS.</returns>  
        public static UInt16 GetOSAddressWidth()  
        {  
            try  
            {  
                SelectQuery query = new SelectQuery("select AddressWidth from Win32_Processor");  
                ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);  
                ManagementObjectCollection moCollection = searcher.Get();  
                foreach (ManagementObject mo in moCollection)  
                {  
                    foreach (PropertyData property in mo.Properties)  
                    {  
                        if (property.Name.Equals("AddressWidth"))  
                        {  
                            return Convert.ToUInt16(property.Value);  
                        }  
                    }  
                }  
          
                throw new Exception("Didn't get expected query result from WMI.");  
            }  
            catch (Exception ex)  
            {  
                throw new Exception("Error occurs in WMI query.", ex.InnerException);  
            }  
        }  
      

  2.   

    自定义操作:http://msdn.microsoft.com/zh-cn/library/3hwzzhyd.aspx