【问题标题】:How to distinguish Windows 7 and Windows 2008 R2如何区分 Windows 7 和 Windows 2008 R2
【发布时间】:2010-10-01 13:25:25
【问题描述】:

我需要区分 Windows 7 和 Windows 2008 R2,但我不知道如何区分。操作系统版本属性返回相同的数字“6.1.7600.0”

问候,

弗洛里安

【问题讨论】:

    标签: c#


    【解决方案1】:

    使用GetProductInfo,Windows 7 和 Windows Server 2008 R2 具有不同的 Product Type 编号。

    Source

    【讨论】:

    • 有关信息,对于 Windows 2008 R2 标准版,GetProductInfo 返回的产品类型值为 7(而不是 3)
    • 这些产品类型掩码是否也在注册表中找到?
    • @jlafay:我不这么认为,GetProductInfo 方法是 Kernel32.lib 的一部分,所以我想它们是硬编码到 Kernel32.dll 中的,但不要引用我的话在那;)
    • 重要补充(花了几个小时来理解问题):对于 windows server 2008 / 2008 r2 IF 设置为域控制器 (dcpromo),产品类型也可以返回 2
    【解决方案2】:

    您可能会发现这很有用:

    http://www.codeproject.com/KB/system/osversion.aspx

    OSProductType 应该是 Server

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-16
      • 2011-08-29
      • 1970-01-01
      • 2018-03-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多