Project Description
BitsMonitor is simple C# 2.0 app that uses BITS to download files from web.
It's main goal is to monitor and manage all downloads (start / suspend, cancel).
New downloads may be added from application itself or a command line arguments.

What is it for?

The idea behind BitsMonitor is to use Windows built-in technology called Background Intelligent Transfer Service (BITS: http://msdn.microsoft.com/en-us/library/windows/desktop/bb968799(v=vs.85).aspx) to download files from web.

BitsMonitor is a simple UI that should make interacting with BITS a lot easier. BitsMonitor has no own code resposible for downloading files... it just passes the information to BITS and monitors download progress, and also is able to auto-complete jobs.

BitsMonitor creates jobs via managed wrapper for BITS. The only additional thing that BitsMonitor tries to do is to resume (restart) jobs if downloading error occurs.

What makes BitsMonitor interesting? At the beginning I wanted to create a Firefox plug-in (I do not use IE almost at all so the choice was obvious) but after looking more carefully at all features offered by Flashgot (Mozilla Firefox plug-in) I realized that support for passing command line arguments to any executable is just what I need.

It became even easier than I thought: Although Flashgot detects automatically whole bunch of download managers, and configures them (so after installation of the plug-in they are ready to use from Flashgot), there is another possibility: Flashgot allows passing arguments to chosen executable, and it is up to developer what kind of argument prefixes they want to use. There are a few arguments you may want to pass to your application: URL, referrer URL, Cookie, Destination folder, POST data, URL list file and cookies.txt file. I use only two of them: destination folder and URL.

bitsmonitor9.png


Configuring BitsMonitor for using with Flashgot

flashgotbitsmonitorconfiguration.png

"Command line argument template" should contain: "--url:URL --dir:FOLDER" (check it again after hitting OK - sometimes the last argument is being lost...)


Limitations.

This app is really simple. It is not able to download files if link doesn't point directly to the file, but to some javascript interface (as here, on codeplex, when user has to accept licence/agreement before downloading file).
Even though BitsMonitor is not able to download files from Codeplex, all MSDN downloads are handled without any problems. BITS is able to download and upload files, but BitsMonitor was designed only as a download-alike tool.


Licenese

This app and all the source code is freely available for anyone. I have used code (BITS Interop) provided by J. Clark in his MSDN Magazine article http://msdn.microsoft.com/en-us/magazine/cc188766.aspx. If you think, I have violated the license - please let me know, or inform Codeplex administator - so this page could be blocked until everything will be clear.
I was looking for an information about license under which all sources shown on MSDN Magazine are published - but I didn't find anything.

Any feedback is welcome!

Last edited Dec 31, 2011 at 10:10 PM by MaciekTalaska, version 8