Click here to Skip to main content
12,079,391 members (35,773 online)
Click here to Skip to main content
Add your own
alternative version

Stats

12.5K views
6 bookmarked
Posted

Checking for Internet Connection in VC++

, 29 Jul 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
Code for checking the avilabiltiy of Internet connection.

Checking for Internet connection can be done using this code:

#include <wininet.h>
#pragma comment(lib,"Wininet.lib")
bool bConnect=InternetCheckConnection(L"http://www.google.com",
              FLAG_ICC_FORCE_CONNECTION ,0);

A return value of true means Internet connection is available.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author


You may also be interested in...

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160212.1 | Last Updated 29 Jul 2011
Article Copyright 2011 by Sayyed Mostafa Hashemi
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid