检测是否安装了ActiveX控件c#示例 [英] detect ActiveX control installed or not c# example
本文介绍了检测是否安装了ActiveX控件c#示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在机器上找到或不安装ActiveX控件c#示例。
问候,
Yogi
yogi
解决方案
你好瑜伽,
引用来自< href ="https://www.codeproject.com/Questions/94714/How-do-I-get-a-list-已安装的ActiveX和删除">
链接,
所有ActiveX控件都列在HKEY_LOCAL_MACHINE \Software \CLASSES \CLSID下。
您可以访问注册表通过以下代码。
static void Main(string [] args)
{
using(var hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine) ,RegistryView.Registry64))
using(var key = hklm.OpenSubKey(@" SOFTWARE\Classes\CLSID"))
{
// key现指向64-位键
foreach(var v in key.GetSubKeyNames())
{
//Console.WriteLine(v);
RegistryKey subKey = key.OpenSubKey(v);
if(subKey!= null){
Console.WriteLine(subKey.GetValue(null));
}
}
}祝你好运,
Neil Hu
Hi,
How to find ActiveX control installed or not on a machine c# example.
Regards,
Yogi
yogi
解决方案
Hello yogi,
Quote from this link,
All the ActiveX controls are listed under HKEY_LOCAL_MACHINE\Software\CLASSES\CLSID.
And you could access registry by below code.
static void Main(string[] args) { using (var hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64)) using (var key = hklm.OpenSubKey(@"SOFTWARE\Classes\CLSID")) { // key now points to the 64-bit key foreach (var v in key.GetSubKeyNames()) { //Console.WriteLine(v); RegistryKey subKey = key.OpenSubKey(v); if (subKey != null) { Console.WriteLine(subKey.GetValue(null)); } } }Best regards,
Neil Hu
这篇关于检测是否安装了ActiveX控件c#示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文