Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Internet access
Message
From
01/12/2010 08:55:17
 
 
To
01/12/2010 07:57:00
Issam Mansour
Jordan Business Machines
Amman, Jordan
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01491356
Message ID:
01491372
Views:
57
I use this
#define INTERNET_CONNECTION_OFFLINE         0x20

function InternetConnected()
	
	local Flags
	store 0 to Flags
	
	return !empty(InternetGetConnectedState(@m.flags, 0)) ;
		and empty(bitand(m.Flags, INTERNET_CONNECTION_OFFLINE))

endfunc
>Hi,
>I am using the following code to check if there is a Internet access, but the codes take a long time to return the result and some time return a Internet access with no internet.
>
>
>Declare SHORT InternetGetConnectedState In wininet ;
>	LONG @ lpdwFlags, Long Reserved
>
>lnFlags = 0
>Reserved = 0
>
>If InternetGetConnectedState(@lnFlags, Reserved) =1
>	&&& Internet access
>
>	#Define  FLAG_ICC_FORCE_CONNECTION 1
>
>	Declare Long InternetCheckConnection In Wininet.Dll String Url, Long dwFlags, Long Reserved
>
>	* Fast and reliable web site
>	lcUrl = "http://www.google.com"
>	If InternetCheckConnection(lcUrl, FLAG_ICC_FORCE_CONNECTION, 0) <> 0
>		m.internet = .T.
>		*	? "Connection is available"
>	Else
>		m.internet = .F.
>		*? "No Connection"
>	Endif
>Else
>	m.internet = .F.
>Endif
>
>
>
>any help,,
>
>Regards
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform