Hi,
I test internet connection usung LoadFromUrl() with an www addres. When return NIL, probably
internet connection is unavailable. But this is only probably, the web site can be currently unavailable,
and these "test" have about 10 second duration. Is another way validate connection?
Piotr
Testing internet connection
Re: Testing internet connection
You can always test https;//google.com first to see if the internet is available.
The eXpress train is coming - and it has more cars.
Re: Testing internet connection
Or to see if the earth is still there...rdonnay wrote:You can always test https;//google.com first to see if the internet is available.

Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Re: Testing internet connection
Hi,
Do the test at startup of your application in a separate thread and save the result. If there is no internet available on that PC, you don't have to wait 10 seconds when you want to use it.
Do the test at startup of your application in a separate thread and save the result. If there is no internet available on that PC, you don't have to wait 10 seconds when you want to use it.
Re: Testing internet connection
Roger,
I use LoadFromUrl() with web addres of my own website. But I search for an another way/function.
Chris, in case when there isn't another way, I will use your suggestion.
Regards Piotr
I use LoadFromUrl() with web addres of my own website. But I search for an another way/function.
Chris, in case when there isn't another way, I will use your suggestion.
Regards Piotr
Re: Testing internet connection
DLLFUNCTION InternetGetConnectedState( Integer1, Integer2 ) USING STDCALL FROM WinInet.DLL
FUNCTION VerifyInternet()
LOCAL lReturn
IF InternetGetConnectedState(0,0) <> 0
lReturn := .T.
ELSE
lReturn := .F.
ENDIF
RETURN lReturn
FUNCTION VerifyInternet()
LOCAL lReturn
IF InternetGetConnectedState(0,0) <> 0
lReturn := .T.
ELSE
lReturn := .F.
ENDIF
RETURN lReturn
Re: Testing internet connection
Thanks for that. Much better solution.DLLFUNCTION InternetGetConnectedState( Integer1, Integer2 ) USING STDCALL FROM WinInet.DLL
The eXpress train is coming - and it has more cars.
Re: Testing internet connection
Hi Pedro.
FUNCTION VerifyInternet()
Thanks for this function. I will implement this today.
FUNCTION VerifyInternet()
Thanks for this function. I will implement this today.

Re: Testing internet connection
Why not
FUNCTION VerifyInternet()
Return ( InternetGetConnectedState(0,0) <> 0 )
Thanks.
Joe
FUNCTION VerifyInternet()
Return ( InternetGetConnectedState(0,0) <> 0 )
Thanks.
Joe
Re: Testing internet connection
Much better. Now everything is perfect!!!Return ( InternetGetConnectedState(0,0) <> 0 )
The eXpress train is coming - and it has more cars.