Ayende @ Rahien

Refunds available at head office

Stories form the class room: Picking the target for BackgroundWorker

I am teaching BackgroundWorker at the moment, and I gave two demos of using it, one with printing and one with the classic long request to the database.

For the student work, I needed to find another sample that I could give them. I tend to like reasonable examples, rather than Hello world ones. I build them the following code to excersize:

WebRequest req = WebRequest.Create("http://www.msdn.com/");

using (WebResponse response = req.GetResponse())

{

    string homePageHTML =

        new StreamReader(response.GetResponseStream()).ReadToEnd();

    textBox1.Text = homePageHTML ;

}

 

At first I tried Google, but that was too fast to be a good demo, msdn.com takes ~15 seconds to get everything from the server, good, solid reason for why we need scalable application.

Sigh, this is so wrong!

Comments

Grimace of Despair
06/25/2007 09:39 PM by
Grimace of Despair

Hehe... pretty ironic you proof an MS failure (MSDN) with an MS succes (.NET)

shawn
06/25/2007 10:46 PM by
shawn

It truly boggles my mind how bad MSDN can be about that type of thing. Even the "new and improved" version they just released isn't much better.

Comments have been closed on this topic.