C#判断某个软件是否已安装实现代码分享
作者:junjie 时间:2022-07-15 16:34:06
private void button1_Click(object sender, EventArgs e)
{
if (checkAdobeReader() == true)
{
MessageBox.Show("有安裝 Adobe Reader ");
}
else
{
MessageBox.Show("沒有安裝 Adobe Reader ");
}
}
/// <summary>
/// 確認是否有安裝 Adobe Reader
/// </summary>
/// <returns>true: 有安裝, false:沒有安裝</returns>
private bool checkAdobeReader()
{
Microsoft.Win32.RegistryKey uninstallNode = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall");
foreach (string subKeyName in uninstallNode.GetSubKeyNames())
{
Microsoft.Win32.RegistryKey subKey = uninstallNode.OpenSubKey(subKeyName);
object displayName = subKey.GetValue("DisplayName");
if (displayName != null)
{
if (displayName.ToString().Contains("Adobe Reader"))
{
return true;
// MessageBox.Show(displayName.ToString());
}
}
}
return false;
}
标签:C#,判断,软件,已安装
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
详解C语言实现猜数字游戏
2023-11-03 04:58:51
![](https://img.aspxhome.com/file/2023/7/105177_0s.jpg)
打印Java程序的线程栈信息方式
2021-11-02 19:00:28
java入门概念个人理解之package与import浅析
2021-07-09 10:18:55
vscode+platformIO开发stm32f4的实现
2023-11-02 16:43:37
![](https://img.aspxhome.com/file/2023/9/105169_0s.png)
详解Spring Boot微服务如何集成fescar解决分布式事务问题
2022-01-21 18:43:51
![](https://img.aspxhome.com/file/2023/1/67951_0s.png)
SpringBoot FreeWorker模板技术解析
2023-08-09 09:14:39
![](https://img.aspxhome.com/file/2023/6/57826_0s.png)
Java对xls文件进行读写操作示例代码
2023-08-04 17:55:31
SpringBoot之通过BeanPostProcessor动态注入ID生成器案例详解
2023-11-24 22:17:26
![](https://img.aspxhome.com/file/2023/1/59251_0s.jpg)
Spring Boot2.3 新特性分层JAR的使用
2021-08-03 12:55:50
![](https://img.aspxhome.com/file/2023/2/65602_0s.jpg)
Mybatis工具类JdbcTypeInterceptor运行时自动添加jdbcType属性
2023-08-24 03:49:59
浅析Java SPI 与 dubbo SPI
2021-10-23 16:54:12
![](https://img.aspxhome.com/file/2023/3/67503_0s.png)
SpringBoot整合Mybatis,解决TypeAliases配置失败的问题
2023-11-28 14:59:24
![](https://img.aspxhome.com/file/2023/8/60448_0s.png)
MyBatis-Plus 如何单元测试的实现
2022-03-02 19:45:08
浅析java中的取整(/)和求余(%)
2023-04-30 23:46:23
java json 省市级联实例代码
2021-11-13 18:50:35
简单探索 Java 中的惰性计算
2023-11-16 20:25:28
jsp如何获取Session中的值
2023-07-01 05:59:28
解析Java的设计模式编程之解释器模式的运用
2022-01-04 04:02:18
![](https://img.aspxhome.com/file/2023/5/63755_0s.jpg)
Spring自动注入失败的解决方法
2022-08-13 03:41:31
一文带你搞懂Java8的LocalDateTime
2023-11-10 02:02:22
![](https://img.aspxhome.com/file/2023/4/59234_0s.png)