2 ms·
I think a closer equivalent of your CoffeScript code in C# would be var HtmlLength = new WebClient().DownloadString("http://news.ycombinator.com").Length;
by ComputerGuru 14y ago
I think a closer equivalent of your CoffeScript code in C# would be
var HtmlLength = new WebClient().DownloadString("http://news.ycombinator.com").Length;
or if you want the length in bytes:
var ByteLength = new WebClient().DownloadData("http://news.ycombinator.com").Length;
Want to do it asynchronously?
var ByteLength = new WebClient().DownloadDataTaskAsync(url).Length;
That code sample you posted is to demonstrate in a rather loquacious fashion the new C# 5.0 features.
As for why create a desktop application rather than a web-based app, I'm not even going to dignify that with a response. Apples and oranges.