How to extract a GUID from a Win32 DLL or OCX(如何从 Win32 DLL 或 OCX 中提取 GUID)
问题描述
我们有一个 .NET 应用程序需要检查可能包含 COM 库(DLL 和 OCX)的文件夹.当我们遇到 COM 库时,我们需要完成的一件事是从 COM DLL 或 OCX 中提取 GUID.
We have a .NET app that needs to examine a folder that may contain COM libraries (DLL and OCX.) When we do encounter a COM library one thing we need to accomplish is to extract the GUID from the COM DLL or OCX.
有没有一种直接的方法可以在不使用 3rd 方库的情况下使用 .NET 来做到这一点?
Is there a straightforward way to do this with .NET without using 3rd party libraries?
推荐答案
这应该适合你.它需要对 c:windowssystem32 lbinf32.dll 的引用,但我认为这没问题,因为它不是第三方组件.
This should work for you. It requires a reference to c:windowssystem32 lbinf32.dll, but I'm assuming that is okay because it isn't a third party component.
Imports TLI 'from c:windowssystem32 lbinf32.dll
Dim reglib As TLI.TLIApplication = New TLI.TLIApplicationClass()
Dim DLLPath As String = "c:mycomponent.ocx"
MsgBox(reglib.TypeLibInfoFromFile(DLLPath).GUID.ToString())
这篇关于如何从 Win32 DLL 或 OCX 中提取 GUID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何从 Win32 DLL 或 OCX 中提取 GUID
基础教程推荐
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
