简体   繁体   English

使用C#的IDM(Internet下载管理器)API?

[英]IDM (Internet download manager) API using C#?

I want to create an application that uses the IDM api, while it's not compiled dll's actually, they are three files created in c++ and their extension are .h, .tlb, .c . 我想创建一个使用IDM api的应用程序,虽然它实际上没有编译dll,它们是用c ++创建的三个文件,它们的扩展名是.h,.tlb,.c。

Here is a link for the page: IDM API . 以下是该页面的链接: IDM API

I want to be able to use these files in a C# project, I googled it, and what I have found is that I have to compile these files to a dll to be able to use them. 我希望能够在C#项目中使用这些文件,我用Google搜索,我发现我必须将这些文件编译成dll才能使用它们。

Please someone take a look at the links and tell me what I can do to use the API, and if it is required to compile these files into a dll please tell me how. 请有人看一下链接并告诉我如何使用API​​,如果需要将这些文件编译成dll,请告诉我如何操作。

Thanks. 谢谢。

You should 你应该

1) download IDMCOMAPI.zip to your disk 1)将IDMCOMAPI.zip下载到您的磁盘

2) extract the IDManTypeInfo.tlb type library from this zip file, somewhere on your disk 2)从磁盘上的某个zip文件中提取IDManTypeInfo.tlb类型库

3) run The Type Library Importer tool like this: 3)运行类型库导入器工具,如下所示:

[C:\Temp]"c:\Program Files\Microsoft SDKs\Windows\\v7.1\Bin\TlbImp.exe" IDManTypeInfo.tlb
Microsoft (R) .NET Framework Type Library to Assembly Converter 3.5.30729.1
Copyright (C) Microsoft Corporation.  All rights reserved.

Type library imported to IDManLib.dll

This will create an IDManLib.dll 这将创建一个IDManLib.dll

4) Now you can reference IDManLib.dll in your project. 4)现在您可以在项目中引用IDManLib.dll。 I have not tested it, but I also suppose you want to ensure your program is compiled with the proper bitness (it depends how the IDM COM Server works). 我还没有对它进行测试,但我也想你要确保你的程序编译得恰到好处(这取决于IDM COM Server的工作原理)。 So, I suggest you compile as X86 ( not anyCpu, not X64). 所以,我建议你编译为X86( 不是任何 Cpu,而不是X64)。

The API seems to be a COM object - did you try looking for it in the Add reference dialog? API似乎是一个COM对象 - 您是否尝试在“添加引用”对话框中查找它? COM objects are registered globally, and judging by that page it should be there if you've run "IDM" on your computer. COM对象在全局注册,如果您在计算机上运行“IDM”,则应该在该页面上进行判断。

I will answer this question after 1 year from asking it, i am not sure what happened but all i did was adding a reference, i just added the tlb file as a reference and the library was imported. 我会在问一年后回答这个问题,我不确定发生了什么,但我所做的只是添加一个引用,我只是添加了tlb文件作为参考,并且导入了库。 I am sure that i tried this before but it didn't work. 我确信我之前尝试过这个但是没有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM