Fastest way to test internet connection

Try using P/Invoke to call InternetGetConnectedState. That should tell you whether or not you have a connection configured. You can then try checking the specific connection to your service using InternetCheckConnection. This is (sometimes) quicker than hooking up the connection directly, but I’d test it to see if it’s any better than just doing a full connection up front.

Leave a Comment