You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

查询Windows 10各版本对应的注册表EditionID键取值

Windows 10 主流版本对应EditionID取值
  • Windows 10 Home:Core
  • Windows 10 Pro:Professional
  • Windows 10 Pro for Workstations:ProfessionalWorkstation
  • Windows 10 Education:Education
  • Windows 10 Pro Education:ProfessionalEducation
  • Windows 10 Enterprise:Enterprise
  • Windows 10 Enterprise LTS/LTSC/LTSB 全版本:EnterpriseS

代码优化说明

你现有代码在32位程序运行在64位系统上时,会因为注册表自动重定向读取不到正确路径的键值,同时需要补充空值判断避免空引用异常,优化后参考代码如下:

// 优先读取64位注册表,避免32位程序重定向问题
using (var hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64))
using (var key = hklm.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion"))
{
    if (key != null)
    {
        var keyValue = key.GetValue("EditionID");
        string osEdition = keyValue?.ToString() ?? string.Empty;
        // 后续业务逻辑
    }
}

内容的提问来源于stack exchange,提问作者RBT

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.29 18:54:05