title: How to detect working internet connection in C#?
body: <p>I have a C# code that basically uploads a file via FTP protocol (using <code>FtpWebRequest</code>). I'd like, however, to first determine whether there is a working internet connection before trying to upload the file (since, if there isn't there is no point in trying, the software should just sleep for a time and check again).</p>
  
  <p>Is there an easy way to do it or should I just try to upload the file and in case it failed just try again, assuming the network connection was down?</p>