tags:

views:

54

answers:

5

As the title says, it is possible to launch Download Manager (such as Orbit) passing the URL of the file to download?

Edit:

How can I check how those programs are expecting the url???
What parameters are needed to be passed ??
My problem is , I do NOT know how those programes are expecting their inputs.

Before that, I also would like to check if one of download managers has installed in the machine.

A: 

If the download manager accepts url arguments then you can start a process and pass the desired URL to it

Process.Start("Orbit.exe -http://www.something.com/file.ext");

So this approach highly depends on the download manager.

Hamid Nazari
A: 

I guess it is kind of depends in the download manger.
If it has support for command line arguments with the file location URL then you can use the System.Diagnostics.Process class.

Itay
+3  A: 

If you want to start an application from C# you can create a new process of the .exe file of the application and if that application supports arguments you can add them also. So you will need to find out if Orbit accepts arguments. The example below shows how to start a new process with arguments. Please note that the application will start out of the process of your own application.

string args = " \"" + URL + "\"";
ProcessStartInfo psi = new ProcessStartInfo("path to Orbit", args);
Process p = Process.Start(psi);
Wouter Janssens - Xelos bvba
thanks..it works...how can I release key strokes on the opened process???
Kai
+1  A: 
string path = @"C:\Program Files\Orbit\Orbit.exe";
string arg = @"http://www.example.com/file.ext";
System.Diagnostics.Process.Start(path, arg);
abatishchev
how can I release key strokes on the opened process???
Kai
@Kai: You mean emulate keys pressing on application window? Please create a separate question. But my opinion I expressed in my another answer to this question: just launch a browser and let user to choose what to do. Probably a downloader will be launched
abatishchev
@abatishchev, Thanks..
Kai
+1  A: 

There is no way to find an abstract downloader on a computer and launch it directly to download a file.

Only one idea I have - launch a browser and hope it will download file by itself or launch a registered downloader:

Process.Start("http://example.com/file.ext");
abatishchev