最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp.net中通过注册表来检测是否安装Office(迅雷/QQ是否已安装)
时间:2022-06-25 03:54:54 编辑:袖梨 来源:一聚教程网
检测Office是否安装以及获取安装 路径 及安装版本
代码如下 | 复制代码 |
#region 检测Office是否安装
|
同理,检测QQ、Fetion、360杀毒、IE浏览器,Chrome、Office 2003/2007/2010
只需修改验证
1 regSubKey = regKey.OpenSubKey(@"SOFTWARETencentPlatForm_Type_List3", false);//如果bool值为true则对打开的项进行读写操作,否则为只读打开
即可
检测QQ是否已安装,通过注册表
代码如下 | 复制代码 |
View Code |
检测迅雷
代码如下 | 复制代码 |
#region 检测 Thunder 迅雷 public static bool isInstallThunder(out string thunderVersion, out string thunderPath) { bool result = false; string str_ThunderPath = string.Empty; string str_ThunderVersion = string.Empty; thunderVersion = string.Empty; thunderPath = string.Empty; GetThunderPath(out str_ThunderPath, out str_ThunderVersion); if (!string.IsNullOrEmpty(str_ThunderPath) && !string.IsNullOrEmpty(str_ThunderVersion)) { result = true; thunderVersion = str_ThunderVersion; thunderPath = str_ThunderPath; } return result; } /// /// /// /// /// private static void GetThunderPath(out string str_thunderPath, out string str_thunderVersion) { string str_PatheResult = string.Empty; string str_VersionResult = string.Empty; string str_KeyName = "Path"; object objResult = null; Microsoft.Win32.RegistryValueKind regValueKind;//指定在注册表中存储值时所用的数据类型,或标识注册表中某个值的数据类型。 Microsoft.Win32.RegistryKey regKey = null;//表示 Windows 注册表中的项级节点(注册表对象?) Microsoft.Win32.RegistryKey regSubKey = null; try { regKey = Microsoft.Win32.Registry.LocalMachine;//读取HKEY_LOCAL_MACHINE项 if (regSubKey == null) regSubKey = regKey.OpenSubKey(@"SOFTWAREThunder NetworkThunderOemthunder_backwnd", false);//如果bool值为true则对打开的项进行读写操作,否则为只读打开 str_VersionResult = "Thunder"; str_KeyName = "Path"; } objResult = regSubKey.GetValue(str_KeyName); regValueKind = regSubKey.GetValueKind(str_KeyName); if (regValueKind == Microsoft.Win32.RegistryValueKind.ExpandString) { str_PatheResult = objResult.ToString(); } } catch (Exception ex) { LogHelper.WriteLogError(ex.ToString()); } finally { if (regKey != null) { regKey.Close(); regKey = null; } if (regSubKey != null) { regSubKey.Close(); regSubKey = null; } } str_thunderPath = str_PatheResult; str_thunderVersion = str_VersionResult; } #endregion |
相关文章
- 排名前十的u币app平台 05-11
- ada币 05-11
- 游米链(YMC币)挖矿的原理 05-11
- 虚拟货币交易平台 05-11
- 加密货币行情 05-11
- Bitpanda(BEST币)挖矿挣钱原理 05-11