Вопрос

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

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top