![]() |
|
|||||||
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
how to check internet connection
Hi all!
I am not a very smart programmer (just for hobby) so bear with me! I have written a small program with MFC to log my internet connections (date and times which are written into a file). Tha fact is that I have to open and close it manually, after I open and close the connection. What I would like to do is this: after I lauch the program, it should monitor possible connections, so that as soon as I connect with Internet it checks the time and when I close the connection it stops it. Are there functions to do this? Thank you all in advance Orlando |
| The Following 2 Users Say Thank You to Hystrio For This Useful Post: | ||
Amit kumar jecrc (02-16-2011), shabbir (05-06-2013) | ||
|
#2
|
|||
|
|||
|
#include <Wininet.h>
#pragma comment(lib,"wininet.lib") if (InternetGetConnectedState(INTERNET_CONNECTION_LAN | INTERNET_CONNECTION_MODEM,0) == FALSE) { // Don't attempt connection or it will bring up the dialog } I've tried it before, it works fine! http://www.experts-exchange.com/Prog..._23262600.html on that link, you'll have to scroll all the way down to see the answer! |
| The Following User Says Thank You to e_pech For This Useful Post: | ||
Amit kumar jecrc (02-16-2011) | ||
![]() |
| Thread Tools | |
| Display Modes | |
|
|
|
|||||||||||||||||||||||||