After finishing the series on screen scraping the thought arose, how small can you make a working scrape. With this in mind the most extreme example was chosen, is a one line scrape Doable?
Surprisingly the answer is yes, and more surprisingly it is still quite clear.
Here is the example code for a conventional scrape and the one line scrape
You will notice in the conventional scrape that variables are declared for the Webclient, stream and stream reader objects, and that they are only used once before they are disposed of.
If you look at the one line example you will see that when the object is created it is no longer assigned to a variable it is just used. Placing () around the object creation allows the object to be accessed as a temporary object, since there is no other reference the object it will be disposed of after execution of the command.