MindFlavor.Net library - Version 2.0

Per la versione italiana della pagina cliccare qui.


Summary

What does it do?

The .Net library has many useful classes, both visual and non visual. But it lacks of visual components to ease the developing of network programs. For example if you need to download a file from a remote server via http you have no aid from .Net. Yes, you have the TcpClient class but it's not visual. And you can't show a simple dialog box to the user: the process may take some time (even on 10 Mb/s networks). To address this problem I've written a freeware library that takes care of file download. Included with the library there's a form that automates the multiple download problem too. The library is completely CLS compliant so you can use it with any .Net language you prefer (C#, Visual Basic .Net, J# and so on). Also the code is completely in .Net so it's not tied on the Windows© platform. It should work on Linux using mono too.

Index

Installation

Once downloaded, unzip the file in a temporary directory. From there you can add the library to your project simply copying it in the root project folder. Alternatively you can install it in the GAC (global assembly cache) issuing this command from a console:

gacutil /i MindFlavor.Net.dll

This way you can use the library in your project without have to copy the DLL in the root project folder. Don't worry: if another version of MindFlavor.Net will be released your code will work the same (this magic belongs to .Net).

Index

How to use

To quickly test the library create a new Windows© application form. Insert two buttons.

SingleDownloader

Here is the code for the first button. It will create a MindFlavor.Net.SingleDownloader instance and launch its download.

private void button1_Click(object sender, System.EventArgs e)
{
	SingleDownloader sd = new SingleDownloader(
		new Uri("http://localhost/yourfilehere"),
		OverwriteMode.Ask,
		true,
		new FileInfo("D:\\temp\\test.zip"));
	sd.Show();
	sd.StartDownload();
}

Of course you have to change the location of your output directory to suit your file system. Here's a screenshot of the program in action:

Image 1 - SingleDownloader

MultiDownloader

Now, let's see how to use the MultiDownloader form. Link the following code to the second button of our test form.

		private void button2_Click(object sender, System.EventArgs e)
{
	Uri[] uris = 
	{
		new Uri("http://localhost/yourfilehere"),
		new Uri("http://localhost/yourfilehere"),
		new Uri("http://localhost/yourfilehere"),
		new Uri("http://localhost/yourfilehere")
	};
	
	MultiDownloader md = new MultiDownloader(
		uris,
		OverwriteMode.PreventCollision,
		true,
		2,
		new DirectoryInfo("D:\\temp"),
		DirectoryGenerationMode.HostAddress);
	
	md.Show();
	md.StartDownload();
}

Here is a screenshot of the program in action:

Image 2 - MultiDownloader

Index

On-line documentation

The on-line documentation is available by clicking here. However you don't need to access the web to view the documentation. A compiled form is bundled with the library. The HTML form is also available as separate download (for the ones that don't like the Windows©'s compressed HTML help).

Index

Download

You can download here the library including the compressed HTML help file for reference. As a separate download you can get the standard HTML help.
Description Version Release date Download size Download
MindFlavor.Net library and the compressed HTML help file. 2.0.1393.28677 October, 25 2003
96 KB
Zipped HTML library documentation. 2.0.1393.28677 October, 25 2003
98 KB

Index

Last update: October 25, 2003

©2003 Francesco Cogno.