title: C# checking Internet connection
body: <p>Can you please tell me if there is a way to check if there is a internet connection in my computer when my C# program is running. For a simple  example, if internet is working, I would output a message box saying <code>Internet is available</code>. else I would output a message saying, <code>Internet is unavailable</code>. </p>
  
  <p>Without using the library function to see if network is available (since this doesn't check internet connectivity)</p>
  
  <pre><code>System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable()
  </code></pre>
  
  <p>Or without opening a webpage and seeing if it's return data</p>
  
  <pre><code>using (WebClient client = new WebClient())
        htmlCode = client.DownloadString("http://google.com");
  </code></pre>
  
  <p>Because both of these above methods don't suit my needs.</p>