22 Sep

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:

function Online: boolean;
begin
  result := (InternetGetConnectedState(nil, 0))
end;
  • Digg
  • del.icio.us
  • Facebook
  • Technorati
  • Google
  • Live
  • YahooMyWeb

Leave a Reply

You must be logged in to post a comment.