|
-
September 10th, 2004, 12:24 AM
#5
Re: Detecting an internet connection.
The online function always return true though i am working in offline. Please tell me what is problem. I aam connected to Internet by LAN.
 Originally Posted by kochhar
I've been using the following function with success. It returns
TRUE if a connection is available, and takes less than
a sec in either case:
Code:
BOOL Online()
{
DWORD dwState = 0;
DWORD dwSize = sizeof(DWORD);
return InternetQueryOption(NULL,
INTERNET_OPTION_CONNECTED_STATE, &dwState, &dwSize)
&& (dwState & INTERNET_STATE_CONNECTED);
}
Credit: I got this from Paul Dilascia's column in MSDN mag a while
back.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|