Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top