1. 程式人生 > >winform 通過驅動註冊ID檢測是否已安裝驅動

winform 通過驅動註冊ID檢測是否已安裝驅動

應該 驅動 aps open gis form closed hide spa

技術分享
 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檢測是否已安裝驅動