Board index » delphi » HOW CAN I KNOW IF A USER IS CONNECTED ON THE INTERNET

HOW CAN I KNOW IF A USER IS CONNECTED ON THE INTERNET

I'm trying to find a way to know when a user connect to the internet via
modem or via high speed edition!

My litle program send me the ip of the machine by e-mail and i would like to
know the IP each time the user connect to the internet.

Thanks
Patrice
patrice.barib...@sympatico.ca

 

Re:HOW CAN I KNOW IF A USER IS CONNECTED ON THE INTERNET


Quote
Patrice Baribeau wrote:
> I'm trying to find a way to know when a user connect to the internet
via
> modem or via high speed edition!

> My litle program send me the ip of the machine by e-mail and i would
like to
> know the IP each time the user connect to the internet.

> Thanks
> Patrice
> patrice.barib...@sympatico.ca

{uses WinInet }
function AnyInetConnection: Boolean;
var F: Cardinal;
begin
  F := $0F;
  Result := InternetGetConnectedState(@Flag, 0);
end;

-ThomasN

Re:HOW CAN I KNOW IF A USER IS CONNECTED ON THE INTERNET


I tryed this code but it doesn't work me.

Regards,
Bojan

Quote
"Thomas Nelvik" <thomas.nel...@sensewave.com> wrote in message

news:AwKE5.7083$Uc.844125@juliett.dax.net...
Quote
> Patrice Baribeau wrote:
> > I'm trying to find a way to know when a user connect to the internet
> via
> > modem or via high speed edition!

> > My litle program send me the ip of the machine by e-mail and i would
> like to
> > know the IP each time the user connect to the internet.

> > Thanks
> > Patrice
> > patrice.barib...@sympatico.ca

> {uses WinInet }
> function AnyInetConnection: Boolean;
> var F: Cardinal;
> begin
>   F := $0F;
>   Result := InternetGetConnectedState(@Flag, 0);
> end;

> -ThomasN

Re:HOW CAN I KNOW IF A USER IS CONNECTED ON THE INTERNET


Quote
Bojan Okorn wrote:
> I tryed this code but it doesn't work me.

> Regards,
> Bojan

You mean the code won't compile, or do you get wrong results.
I managed to ship a "small" bug. :o
Here's how it should be.
And this works for me. (Win98, modem connection)

{uses WinInet }
function AnyInetConnection: Boolean;
var F: Cardinal;
begin
  F := $0F;
  Result := InternetGetConnectedState(@F {corrected}, 0);
end;

Regards
-ThomasN

Other Threads