Page 1 of 1
Check internet status
Posted: Wed Aug 28, 2013 9:16 am
by feelself
Hello, everyone. i need to do the project by live code to check the whether there have the internet connection, and then if have internet, then can update some new informations in , Anyone got any idea? Really confused now.
Re: Check internet status
Posted: Wed Aug 28, 2013 10:39 am
by Mark
Hi,
There are several ways to do this. The easiest way is to put a tine file on your server, e.g. with just a "1", and check if you can download this file:
Code: Select all
put url "http://www.yourdomain.xyz/the1.htm" into myStatus
put the result into rslt
if rslt is not empty then
beep
answer error rslt
else if myStatus is 1 then
// do your thing
else
beep
answer error "Sorry, an error occurred."
end if
In some cases, I've noticed that rslt would also contain the URL that is being contacted. I guess that is/was a bug. So, you might want to check for this as well:
Code: Select all
if rslt is not empty and not (rslt begins with "http") then
Kind regards,
Mark
Re: Check internet status
Posted: Wed Aug 28, 2013 11:09 am
by Klaus
Hi feelself,
please only ONE thread (in ONE forum) for the same question!
I deleted all other threads with your question!
Best
Klaus