I’m writing a Silverlight 4 application and would like to check when opening the installed out of browser application, whether there is a valid internet connection (to then download some data from my website). What is the best way to do this? I realise that I could put a try catch around a WebRequest but that seems a bit hacky to me.
EDIT: What I meant by valid internet connection is just connected to the internet
You can just kill two birds with one stone with Application.CheckAndDownloadUpdateAsync. When you get a
FalseonUpdateAvailablein handling Application.CheckAndDownloadUpdateCompleted, it’s going to mean either one of two things – your site can’t be reached or there is no update available. In either case, you’ll know what you need to know.