确定最高的.NET Framework版本

确定最高的.NET Framework版本

问题描述:

我需要确定安装在C \ C ++ code台式机上最高的.NET framework版本。貌似我可以遍历在的%systemroot%\ Microsoft.NET \框架文件夹,但似乎有种很容易出错的。有没有更好的办法?也许一个注册表项,我可以检查?谢谢你。

I need to determine the highest .NET framework version installed on a desktop machine from C\C++ code. Looks like I can iterate the folders under %systemroot%\Microsoft.NET\Framework, but that seems kind of error prone. Is there a better way? Perhaps a registry key I can inspect? Thanks.

使用 Windows注册表位置 HKEY_LOCAL_MACHINE \ SOFTWARE \微软\ NET Framework安装\新民主党