0

I need to develop a few lines to check if a running program has internet access in general, or at least if it can access a specific domain or ip.

How do you implement this? It should be platform-independent so using bash or cmd is not the optimal solution.

Cheers, Tate

Tate83
  • 274
  • 1
  • 7
  • 21

1 Answers1

1

Tate. One way is to create a simple page on the site that returns a specific word when the URL is visited (tCheckURL). Then you can;

put URL tCheckURL into tContent
if tContent = "Online" then
  ...
end if

In the example above, the URL should only return the word "Online", so if you receive anything else instead (blank, ISP error, etc...), you know that access to the site is temporarily down.

splash21
  • 799
  • 4
  • 10
  • Thanks, this is certainly the easiest way. I was thinking along the way of http error codes but probably that is taking it too far or complex. – Tate83 Apr 30 '14 at 07:38