uses WinInet;
begin
if InternetGetConnectedState (
INTENET_CONNECTION_MODEM or
INTENET_CONNECTION_LAN or
INTERNET_CONNECTION_PROXY) then
// do whatever you need to do to connect to the server...
end;
With NT, you will need IE 4 or later, with 98, ME or 2K, should be OK. The
only gotcha with this method is it tells you whether there has been an
internet connection - not whether the connection is still alive.
Regards,
Dennis.
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 19 June 2001 14:18
> To: Multiple recipients of list delphi
> Subject: [DUG]: Checking if dialup TCP connection is active
>
>
> Hi there,
> (In case this is easy/old hat). One of our applications has to
> detect whether the system is currently online (via modem) and, if
> so, briefly open a socket connection to a remote server.
>
> Does anyone have any Delphi logic or know of componentry which
> can reliably and with minimal overhead or delay, detect whether a
> modem-based TCP connection is currently open, or not?
> Desirably, it needs to work on Win9x/ME as well as WinNT/2K.
>
> Thanks!
> ------------------------------------------------------------------
> ---------
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"