通过注册表查询当前计算机.net版本

.net framework 1-4

在注册表项HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDP下,安装的版本将在 NDP 子项的下方列出。 版本号存储在“版本”项中。 对于 .NET Framework 4,“版本”项位于客户端或完整子项下(在 NDP 下),或在这两个子项下。

.net framework 4.5或更高版本

查看HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv4Full下,ReleaseDWORD的值

Release DWORD 的值 版本
378389 .NET Framework 4.5
378675 使用 Windows 8.1 或 Windows Server 2012 R2 安装的 .NET Framework 4.5.1
378758 安装在 Windows 8、Windows 7 SP1 或 Windows Vista SP2 上的 .NET Framework 4.5.1
379893 .NET Framework 4.5.2
仅在 Windows 10 系统上:393295
在所有其他操作系统版本上:393297
.NET Framework 4.6
仅在 Windows 10 11 月更新系统上:394254
在所有其他操作系统版本上:394271
.NET Framework 4.6.1
在 Windows 10 周年更新和 Windows Server 2016 上:394802
在所有其他操作系统版本上:394806
.NET Framework 4.6.2
仅在 Windows 10 创意者更新上:460798
在所有其他操作系统版本上: 460805
.NET Framework 4.7
仅在 Windows 10 秋季创意者更新上:461308
在所有其他操作系统版本上:461310
.NET Framework 4.7.1
仅 Windows 10 2018 年 10 月更新上:461814
仅 Windows 10 2018 年 4 月更新中:461808
在所有其他操作系统版本上:461814
.NET Framework 4.7.2

例子如下图:

.net framework 4.5示例图

原文地址:https://www.cnblogs.com/mosakashaka/p/12608186.html