Top

Tags


Roadkill .NET Wiki

Google ads

Recommended reading


Search

Thursday
May242007

Streaming binary/text data via the web in C#

This rough example was originally intended for auto-update functionality in an application (it downloads the new .exe, runs a bootstrap application that replaces the existing .exe with the new one, and runs it).

The code is a windows forms application that shows 3 ways of performing the download. The first is the built in DownloadFile method in the WebClient class. The 2nd shows streaming HTML from a website into a listbox (you'll need to add a listbox to the form for this). The 3rd downloads winrar from rarlabs.com and streams the file to disk. The first 2 methods have been commented out.

It includes a progress bar to show the progress, and total bytes expected. The solution is in Visual Studio 2005 format. The application assumes you have a c:\ drive to download onto.

For now it doesn't deal with different content types, it's pretty basic.

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
« C# XML Browser demo app | Main | Binary upload to SQL Server in C# »