How to add download links to IDM from a program [closed]

人走茶凉 提交于 2019-12-23 06:20:19

问题


I want to add some links to the IDM. can anyone give me a pseudo code for doing that. or a link to a page that explains how to do it.


回答1:


You may start IDM from the command line using the following parameters

idman /s

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

Parameters:

/d URL - downloads a file

e.g. IDMan.exe /d "internetdownloadmanager.com/path/FileName.zip"

/s - starts queue in scheduler

/p local_path - defines the local path where to save the file

/f local_file_name - defines the local file name to save the file

/q - IDM will exit after the successful downloading. This parameter works only for the first copy

/h - IDM will hang up your connection after the successful downloading

/n - turns on the silent mode when IDM doesn't ask any questions

/a - add a file specified with /d to download queue, but don't start downloading

Parameters /a, /h, /n, /q, /f local_file_name, /p local_path work only if you specified the file to download with /d URL

Examples

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

For More Information Visit :https://www.internetdownloadmanager.com/support/command_line.html




回答2:


You can add links to IDM by passing the "-d" argument to IDMan.exe

From in your program or script, (you can use ShellExecute or the equivalent in whatever language you're using,) call [IDM Install Path]\IDMan.exe -d [link]

[IDM Install Path]: The directory where idm is installed
(eg. C:\Program Files\Internet Download Manager)

[link]: The url you want to add to IDM




回答3:


I know this is an old question but I want to share my approach for those who has the same question

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);
        }
    }

to call the function

 SendLinkToIdm("http://mirror2.internetdownloadmanager.com/idman630build10.exe");



回答4:


For doing so, The IDM shoulda support this kind of stuff, as i know it's not possible, but if you find any library or RPC way to send the data to IDM then yes!



来源:https://stackoverflow.com/questions/8746703/how-to-add-download-links-to-idm-from-a-program

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!