C# 2008 SP1
I am using this code to connect to our client website. This is for a softphone application. Before the user makes a call, the softphone has to test if th
request.GetResponse() itself will give you an exception if the host name can't be resolved, though, so you might want to put a try-catch around that, catch System.Net.WebException, and check its error status in the Status property. I'm not sure which statuses exactly would indicate no internet, though; most responses could just as well be due to dns or other connection problems.