I’d like to execute an HttpWebRequest in a separate thread.
For example I have:
public string GetPage(string url)
{
string html = new WebClient().DownloadString(url);
return html;
}
How would I run this in a separate thread without much hassle?
I have tried starting a simple thread but I have no idea how to return the HTML.
To do it “without much hassle”, use c# 5.0