Please see my comment to the question. If you don't mind killing this process: the method
Process.Start
will return an instance of
System.Diagnostics.Process
:
System.Diagnostics.Process process = System.Diagnostics.Process.Start();
process.Kill();
If what you start is really an Internet Download Manager, it will certainly stop downloading :-).
However, this is not nice; and you won't know which of the files was only partially downloaded as you broke it in the middle.
Generally, using
Process.Start
is not a developer's approach. A real software developers will use its own downloading code embedded in your application, which is actually much simpler because you can get a full access to the functionality and progress. In contrast to the situation with external processes: they are well isolated; you cannot do much for controlling them.
Please see my full source code for HttpDownloader, use it the way you like:
how to download a file from internet[
^].
This application has a special feature: an ability to continue incomplete download later, starting from the same place.
See also my past answers:
FTP: Download Files[
^],
how to download a file from the server in Asp.net 2.0[
^].
—SA