码迷,mamicode.com
首页 > Windows程序 > 详细

winform 通过驱动注册ID检测是否已安装驱动

时间:2017-09-05 22:58:42      阅读:238      评论:0      收藏:0      [点我收藏+]

标签:参数   技术分享   tin   als   hid   应该   info   reg   指定   

技术分享
 1  public bool IsRegistered()
 2         {
 3             string clsid = ConfigurationManager.AppSettings["clsid"];
 4             //参数检查
 5             Debug.Assert(!String.IsNullOrEmpty(clsid), "clsid 不应该为空");
 6             //设置返回值
 7             bool result = false;
 8             //检查方法,查找注册表是否存在指定的clsid
 9             string key = $@"CLSID\{{{clsid}}}";
10             RegistryKey regKey = Registry.ClassesRoot.OpenSubKey(key);
11             if (regKey != null)
12             {
13                 result = true;
14             }
15             return result;
16         }
View Code

 

winform 通过驱动注册ID检测是否已安装驱动

标签:参数   技术分享   tin   als   hid   应该   info   reg   指定   

原文地址:http://www.cnblogs.com/Tcwangyu/p/7482276.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!