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!

Print | posted on Monday, June 25, 2007 8:54 PM

Feedback


# re: Stories form the class room: Picking the target for BackgroundWorker 6/26/2007 12:39 AM Grimace of Despair

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


Gravatar

# re: Stories form the class room: Picking the target for BackgroundWorker 6/26/2007 1:46 AM 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.