to check for Internet connection in vc++.net-Collection of common programming errors
You can use InternetGetConnectedState
using namespace System::Runtime::InteropServices; ... [DllImport("wininet.dll")]
static bool InternetGetConnectedState(int connectionDescription, int reservedValue); static bool IsConnected()
{ int connectionDescription = 0; return InternetGetConnectedState(connectionDescription, 0);
}
and then use IsConnected.