Im currently trying to figure out why my application hangs when i try to download some content from the web.
I created a sample win forms app in .net 4.5 with a simple button and text box. button click handler is below: What happens is, the application launches as expected, however, once i click on the button, the app stalls on wc.DownloadString()
Code: Select all
private void btnWebClient_Click(object sender, EventArgs e)
{
using (WebClient wc = new WebClient())
{
string sReturn = wc.DownloadString(URL);
txtWebClientOut.Text = sReturn;
}
}