Look here:
function NetConnection(Var NetType : String): Boolean; var flags: DWORD; begin Result := InternetGetConnectedState(@flags, 0); if Result then begin if (flags and INTERNET_CONNECTION_MODEM) = INTERNET_CONNECTION_MODEM then NetType := 'Modem'; if (flags and INTERNET_CONNECTION_LAN) = INTERNET_CONNECTION_LAN then NetType := 'LAN'; if (flags and INTERNET_CONNECTION_PROXY) = INTERNET_CONNECTION_PROXY then NetType := 'Proxy'; if (flags and INTERNET_CONNECTION_MODEM_BUSY) = INTERNET_CONNECTION_MODEM_BUSY then NetType := 'Modem Busy'; end; end;
Maybe the value from InternetGetConnectedState is not working as supposed, this is a function that comes directly from wininet.dll
Anyone knows an alternative to know if wether a machine is online or not?