My C# windows forms app downloads a short string form an url. It parses the string and shows info. It is used purely for this. Sort of a pop up program. I am using this:
using (WebClient wc = new WebClient())
{
string json = wc.DownloadString(url);
//parse the string
//show windows form with the gathered data
this.Show()
}
My problem is, when there is no internet connection, unhandled exception error pops up. I think that I need to prevent this error message and just keep the program rolling until the connection is back up. How to prevent the message and keep it running?