Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Internet access
Message
From
01/12/2010 08:02:30
 
 
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:
01491357
Views:
67
I have ised this function for a long time
Function InternetOK
Lparameters lcmyFastLoadedSite
#define FLAG_ICC_FORCE_CONNECTION 0x01
If Pcount()=0
  lcmyFastLoadedSite = "192.168.1.133" && "http://www.dir.bg"
EndIf 
DECLARE INTEGER InternetCheckConnection IN wininet STRING lpszUrlSTRING, INTEGER dwFlags, INTEGER dwReserved
Return InternetCheckConnection(lcmyFastLoadedSite,FLAG_ICC_FORCE_CONNECTION,0)=1
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform