private static bool GetDotNetRelease(int release)

{
const string subkey = @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\";
using (RegistryKey ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey(subkey))
{
if (ndpKey != null && ndpKey.GetValue("Release") != null)
{
return (int)ndpKey.GetValue("Release") >= release ? true : false;
}
return false;
}
}
 
//release是你需要检测的版本号,比如.NET4.0,输入4

相关文章:

  • 2021-07-06
  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
  • 2022-01-30
  • 2021-12-13
  • 2021-09-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2021-10-29
  • 2022-02-07
  • 2022-12-23
相关资源
相似解决方案