To be clear, does this just grab the page's resulting HTML code and print it onto the console in a giant glob of text and symbols? What is the purpose of doing so?
You could also rewrite the StreamReader code to use a "using" code block, which would forego the need to close both data, and reader, as they will both be closed automatically.
using (StreamReader sr = new StreamReader(client.OpenRead(args[0]))) {
while (!sr.EndOfStream)
Console.WriteLine(sr.ReadLine());
}
@SunnyD I think u r rite. Let me write an updated version of this snippet. Thanks for pointing it out.