13
sbeskur's response has a bug in the translation of InternetGetConnectedState. The parameters are both DWORD's (first one is an LPDWORD). Both of these translate to int's in C# (technically, uint but int will work for most scenarios).
Correct translation below.
[DllImport("wininet.dll", SetLastError=true)]
public static extern bool InternetGetConnectedState(out int flags,int reserved);