Delphi: Check Internet Connection [SOLVED]

Recently a lot of apps right now are becoming internet dependent. Currently the project I am working on requires the system to know if there is internet or not.

Here is the code snippet I found

uses WinInet;
 
var
  origin: cardinal;
begin
  if InternetGetConnectedState(@origin,0) then
    ShowMessage('Connected!')
  else
    ShowMessage('Not connected')
  end;
end;

Enjoy

Coffee Cup

 18 total views,  3 views today

Leave a Reply

Your email address will not be published. Required fields are marked *