Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Internet Connections

[b][red]This message was edited by FactorSoftware at 2003-3-17 9:42:2[/red][/b][hr]
Hello and thank you for reading this message!

Here is my problem!
I need to find a way to detect an active internet connection so that my app can make a log of the time that the user is connected to the internet!
To do that i must detect when an internet connection is oppened and closed, so that i can count the time that the user is surfing the net!
If anybody knows of a way to do this, please let me know!

Thank your time and goodbye!
CrazyMenConnected
Email(s):
CrazyMenConnected@ViaNW.pt




Comments

  • injektiloinjektilo Member Posts: 113
    i hope you are using delphi6 or later cause you need the indy component TIdIPWatch. (easy solution).

    make sure it is Active:
    [code]
    procedure TForm1.FormCreate(Sender: TObject);
    begin
    IdIPWatch1.Active := True;
    end;
    [/code]

    then some code in the StatusChanged event of the component
    [code]
    procedure TForm1.IdIPWatch1StatusChanged(Sender: TObject);
    begin
    if IdIPWatch1.IsOnline then
    begin
    ShowMessage(IdIPWatch1.CurrentIP);
    end;
    end;
    [/code]

    thats it
  • FactorSoftwareFactorSoftware Member Posts: 19
    : i hope you are using delphi6 or later cause you need the indy component TIdIPWatch. (easy solution).
    :
    : make sure it is Active:
    : [code]
    : procedure TForm1.FormCreate(Sender: TObject);
    : begin
    : IdIPWatch1.Active := True;
    : end;
    : [/code]
    :
    : then some code in the StatusChanged event of the component
    : [code]
    : procedure TForm1.IdIPWatch1StatusChanged(Sender: TObject);
    : begin
    : if IdIPWatch1.IsOnline then
    : begin
    : ShowMessage(IdIPWatch1.CurrentIP);
    : end;
    : end;
    : [/code]
    :
    : thats it
    :

    By the time that i post this problem in the message boards i was still using Delphi 5!
    I am now using Delphi 7, whitch has the Indy Component, and your piece of code work's just fine!
    Thank you for your reply! :-)


Sign In or Register to comment.