<p>What is the best way to determine whether there is an available Internet connection for a WinForms app. (Programatically of course) I want to disable/hide certain functions if the user is not connected to the Internet.</p>

I'm not a c# developer but in C++ you can use the Win32 API (specifically from Wininet.dll) like this:
```
```
bool IsInternetConnected( void )
{
    DWORD dwConnectionFlags = 0;

    if( !InternetGetConnectedState( &dwConnectionFlags, 0 ) )
        return false;

    if( InternetAttemptConnect( 0 ) != ERROR_SUCCESS )
        return false;

    return true;
}
```
```
I assume this is trivially turned into c#