Es geht natürlich auch so (unter Windows zumindest):
Delphi-Quellcode:
function HasInternet: boolean; //WinInet
var dwConnectionTypes: DWord;
begin
dwConnectionTypes := INTERNET_CONNECTION_MODEM + INTERNET_CONNECTION_LAN +
INTERNET_CONNECTION_PROXY;
result := InternetGetConnectedState(@dwConnectionTypes, 0);
end;
Christian