【问题标题】:Win32_WindowsProductActivation ProductID equivalent in Software Licensing Classes软件许可类中的 Win32_WindowsProductActivation ProductID 等效项
【发布时间】:2012-03-16 09:03:28
【问题描述】:

我有一段旧代码使用 WQL 查询从 Win32_WindowsProductActivation 类进入。

SELECT * FROM Win32_WindowsProductActivation

然后它对其进行迭代,并基本上使用了 ProductID 字符串

hres = pclsObj->Get("ProductID", 0, &vtProp, 0, 0);

return WideString(vtProp.bstrVal);

我想稍微清理一下,也想让它在 Windows 7 中运行,并注意到对 Win32_WindowsProductActivation 类的支持在 Windows Vista 中被删除了。我还读到软件许可类现在提供了类似的功能。上面的软件许可类等效项如何看待?

我似乎看不到哪个 exat 字段会返回相同的值。猜测 SoftwareLicensingProduct 类的 ProductKeyID。但是还有其他听起来像 likley 的候选人:)

【问题讨论】:

    标签: c++ winapi windows-7 wmi


    【解决方案1】:

    Win32_WindowsProductActivation 状态的 ProductID 属性

    格式中用连字符分隔的 20 个字符的字符串, xxxxx-xxx-xxxxxxx-xxxxx。这与显示的产品 ID 相同 在 Control 中 System Properties 对话框的 General 选项卡下 面板。

    现在,如果您检查 Windows 7 中 SoftwareLicensingProduct WMI 类的 ProductKeyID 属性的值,这与“系统属性”对话框的 ProductID 不匹配。

    解决方案是使用Win32_OperatingSystemSerialNumber 属性,这适用于Windows XP、Vista 和7(以及Windows 服务器版本)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-18
      • 1970-01-01
      • 1970-01-01
      • 2020-08-30
      • 2012-09-23
      • 2010-09-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多