private static string GetConnectedState() { RASInfo.InternetConnectionState internetConnectionState = (RASInfo.InternetConnectionState) 0; if (RASInfo.InternetGetConnectedState(ref internetConnectionState, 0)) { return("CONNECTED (" + internetConnectionState.ToString() + ")"); } return("NOT_CONNECTED (" + internetConnectionState.ToString() + ")"); }
internal static extern bool InternetGetConnectedState(ref RASInfo.InternetConnectionState lpdwFlags, int dwReserved);