chai2020

导航

 

public static bool IsNet35Installed()
{
// 检查注册表项以确定是否安装了.NET Framework 3.5
const string subkey = @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5";
try
{
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(subkey))
{
if (key != null && key.GetValue("Install", 0) as int? == 1)
{
return true;
}
}
}
catch { }
return false;
}

posted on 2024-05-15 09:44  反反西  阅读(159)  评论(0)    收藏  举报