Connected to Internet?
Sometimes you need to know if the computer on which your program is running has
Internet connection in order to check for updates connect to a server and serve asslave :)
Add "WinInet" to uses clause.
function ConnectedToNet: boolean;
var
flags: DWORD;
begin
Flags :=
INTERNET_CONNECTION_MODEM or
INTERNET_CONNECTION_LAN or
INTERNET_CONNECTION_PROXY or
INTERNET_CONNECTION_MODEM_BUSY;
result := InternetGetConnectedState(@Flags, 0);
end;
Usage
ShowMessage(BoolToStr(ConnectedToNet, True));
source
comments