如何检查COM DLL注册或不与C#? [英] How to check COM dll is registered or not with C#?

查看:89
本文介绍了如何检查COM DLL注册或不与C#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要检查是否msdia100.dll被注册了,我为了与命令的regsvr32.exe 注册DLL运行的计算机系统。我怎么能做到这一点的C#?

I need to check if msdia100.dll is registered on a computer system that I'm running in order to register the dll with the command regsvr32.exe. How can I do that with C#?

推荐答案

您可以通过注册表此搜索。假设你不知道包含在DLL中的COM对象,你就必须开始 HKEY_CLASSES_ROOT 首先寻找的DLL名称。

You can search through the registry for this. Assuming that you don't know the COM objects contained in the DLL you'll have to start looking for the DLL name first in HKEY_CLASSES_ROOT.

然后,使用类名来查找 HKEY_CLASSES_ROOT\ [类名] \CLSID 的CLSID最后你应该能够找到它的CLSID为 HKEY_CLASSES_ROOT\CLSID\ [CLSID]

Then use the class name to find the CLSID in HKEY_CLASSES_ROOT\[ClassName]\CLSID and finally you should be able find it the CLSID as HKEY_CLASSES_ROOT\CLSID\[CLSID].

请注意,从内存中写入注册表位置,可能会是一个。咬下

Please note, registry locations written from memory so might be a bit off.

编辑:或者,如果你知道类的名字,你可以只尝试创建它的一个实例,看看是否可行与否

Or if you know the class name you could just try to create an instance of it and see if it works or not.

这篇关于如何检查COM DLL注册或不与C#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆