3

我想向 IDM 添加一些链接。谁能给我一个伪代码来做到这一点。或指向说明如何操作的页面的链接。

4

4 回答 4

6

您可以使用以下参数从命令行启动 IDM

idman /s

或者idman /d URL [/p local_path] [/f local_file_name] [/q] [/h][/n] [/a]

参数:

/d URL - 下载文件

例如 IDMan.exe /d "internetdownloadmanager.com/path/FileName.zip"

/s - 在调度程序中启动队列

/p local_path - 定义保存文件的本地路径

/f local_file_name - 定义保存文件的本地文件名

/q - IDM 将在成功下载后退出。此参数仅适用于第一个副本

/h - IDM 会在下载成功后挂断你的连接

/n - 当 IDM 不问任何问题时打开静音模式

/a - 将 /d 指定的文件添加到下载队列,但不开始下载

参数/a、/h、/n、/q、/f local_file_name、/p local_path仅在您使用/d URL指定要下载的文件时起作用

例子

C:>idman.exe /n /d tonec.com/download/idman317.exe

欲了解更多信息,请访问:https ://www.internetdownloadmanager.com/support/command_line.html

于 2015-07-09T09:24:10.607 回答
3

您可以通过将“-d”参数传递给 IDMan.exe 来添加指向 IDM 的链接

从您的程序或脚本中,(您可以使用ShellExecute或您使用的任何语言的等价物)调用[IDM 安装路径] \IDMan.exe -d [链接]

[IDM 安装路径] : idm 的安装目录
(eg. C:\Program Files\Internet Download Manager)

[link] : 要添加到 IDM 的 url

于 2014-05-03T13:11:57.690 回答
3

我知道这是一个老问题,但我想为那些有同样问题的人分享我的方法

public void SendLinkToIdm(string url)
    {
        try
        {
            bool x_32 = System.IO.Directory.Exists(@"C:\Program Files\Internet Download Manager"); // check if system is 32bit
            bool x_64 = System.IO.Directory.Exists(@"C:\Program Files (x86)\Internet Download Manager"); // check if system is 64bit and you have installed 32bit programs on it 
            if (x_32 == true | x_64 == true) // if any of the above directories exist it means you have idm installed 
            {                    
                System.Diagnostics.Process p = new System.Diagnostics.Process(); // Start the child process.                    
                p.StartInfo.UseShellExecute = false; // Set the useshellExecute to false 
                p.StartInfo.RedirectStandardOutput = true; // Redirect the output stream of the child process.
                p.StartInfo.FileName = @"C:\Windows\System32\cmd.exe"; // specify the location of the command line 
                p.StartInfo.Verb = "runas";
                p.StartInfo.CreateNoWindow = true; // eliminate the process window
                if(x_32 == true)
                    p.StartInfo.Arguments = @"/C cd %programfiles%\Internet Download Manager && IDMan.exe /d " + "\"" + url + "\""; // first go to the idm location then execute the command 
                else
                    p.StartInfo.Arguments = @"/C cd C:\Program Files (x86)\Internet Download Manager && IDMan.exe /d " + "\"" + url + "\"";
                p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
                p.Start(); // now when all is set run the process 
                p.WaitForExit(); // Waits here for the process to exit.
            }
            else
                MessageBox.Show("Please install Internet Download Manager " + System.Diagnostics.Process.Start("https://www.internetdownloadmanager.com/download.html")); // open the download page of the idm in the browser
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);
        }
    }

调用函数

 SendLinkToIdm("http://mirror2.internetdownloadmanager.com/idman630build10.exe");
于 2018-06-02T22:26:47.347 回答
-1

为此,IDM 应该支持这种东西,因为我知道这是不可能的,但是如果您找到任何库或 RPC 方式将数据发送到 IDM,那么是的!

于 2012-02-11T11:33:45.413 回答