how to advertent to connect to internet?

with use the Wininet unit, we can discern to connect to internet.
this function is sample:

uses Wininet ;

function isconnected : Boolean ;
var
  connectiontype: DWORD ;
begin
  connectiontype:=INTERNET_CONNECTION_MODEM // type of connection
                  +INTERNET_CONNECTION_LAN
                  +INTERNET_CONNECTION_PROXY ;
  Result:=InternetGetConnectedState(@connectiontype,0);//are we connect?
end;

is result = true then the system is connect to internet

你可能感兴趣的:(internet)