Click here to Skip to main content
Click here to Skip to main content

Checking for Internet Connection in VC++

By , 29 Jul 2011
Rate this:
Please Sign up or sign in to vote.

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)

About the Author

Sayyed Mostafa Hashemi
Software Developer (Senior)
Iran (Islamic Republic Of) Iran (Islamic Republic Of)
I am Mostafa Hashemi.I was born in Tehran. I graduated from IUMS university in 2002 (1381). Although my university field different from programming, but I like it. Since I acquainted with computer, I have been interested in Visual C++. I have been beginning to program in Visual C++ in 2003.
Thanks,
http://www.sischer.ir

Comments and Discussions

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