编程技术 · 2022 年 11 月 24 日 0

c# 通过注册表判断本机是否安装chrome浏览器

c# 通过注册表判断本机是否安装chrome浏览器


public static bool is_Chrome()
{
try
{
string app = "chrome.exe";
RegistryKey regKey = Registry.LocalMachine;
RegistryKey regSubKey = regKey.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\" + app, false);
string strKey = string.Empty;
object objResult = regSubKey.GetValue(strKey);
RegistryValueKind regValueKind = regSubKey.GetValueKind(strKey);
return true;

}
catch
{
MessageBox.Show(“请检查本机是否安装谷歌Chrome浏览器!”, “提示”);
return false;
}
}