Online / offline status detection
There are few methods to check if computer is online (=connected) or offline (=disconnected). This one is really simple.
We need just one line of code and we will use WinInet unit. Whole function is here:
1 2 3 4 |
<span style="font-weight: bold;">function</span> Online: <span style="font-weight: bold;">boolean</span>; <span style="font-weight: bold;">begin</span> result := (InternetGetConnectedState(<span style="font-weight: bold;">nil</span>, 0)) <span style="font-weight: bold;">end</span>; |