Monitoring Trafic (In/Out)

cs_Toshiiro Messages postés 9 Date d'inscription mardi 28 avril 2009 Statut Membre Dernière intervention 3 mai 2009 - 1 mai 2009 à 18:22
cs_Toshiiro Messages postés 9 Date d'inscription mardi 28 avril 2009 Statut Membre Dernière intervention 3 mai 2009 - 3 mai 2009 à 11:29
Bonjour à tous et à toutes.
Voilà, je voudrais pouvoir afficher dans deux labels, le trafic IN et OUT.
J'ai chercher du côté de la source "Network Trafic Monitor" mais je n'arrive pas à isolé seulement ça. Il y à trop de truck pour moi, pauvre débutant que je suis -_-.

J'ai déjà les fichiers IPHelper, IPHLApi (et TrafficUnit, je sais pas si utile ou non).

Je vous remercie d'avance

4 réponses

f0xi Messages postés 4205 Date d'inscription samedi 16 octobre 2004 Statut Modérateur Dernière intervention 12 mars 2022 35
1 mai 2009 à 23:30
TTraffic --> TrafficUnit.pas
dependance --> IPHelper, IPHLPAPI

var
  MainForm: TMainForm;
  ActiveTraffic : TTraffic;

procedure TMainForm.RefreshDisplay;
begin
  if not Assigned(ActiveTraffic) then
  begin
    ClearDisplay;
    Exit;
  end;

  with ActiveTraffic do
  begin

    FreezeButton.Visible := Connected;
    UnFreezeButton.Visible := Connected;
    ClearCountersButton.Visible := Connected;
    RemoveInactiveButton.Visible := not Connected;

    FreezeButton.Enabled := Running;
    UnFreezeButton.Enabled := not Running;

    ledAdapterDescription.Text := Description;
    ledMACAddress.Text := MAC;

    ledSpeed.Text := BitsToFriendlyString(Speed);

    ledOctInSec.Text := BytesToFriendlyString(InPerSec);
    ledPeakInSec.Text := BytesToFriendlyString(PeakInPerSec);
    ledAvgINSec.Text := BytesToFriendlyString(AverageInPerSec);
    ledTotalIN.Text := BytesToFriendlyString(InTotal);

    ledOctOUTSec.Text := BytesToFriendlyString(OutPerSec);
    ledPeakOUTSec.Text := BytesToFriendlyString(PeakOutPerSec);
    ledAvgOUTSec.Text := BytesToFriendlyString(AverageOutPerSec);
    ledTotalOUT.Text := BytesToFriendlyString(OutTotal);

    self.ledStartedAt.Text := DateTimeToStr(StartedAt);
    self.ledActiveFor.Text := FriendlyRunningTime;

    StatusText.Caption := GetStatus;
  end;//with
end; (*RefreshDisplay*)

<hr size="2" width="100%" />
0
cs_Toshiiro Messages postés 9 Date d'inscription mardi 28 avril 2009 Statut Membre Dernière intervention 3 mai 2009
1 mai 2009 à 23:51
Salut, merci de ta réponse, mais j'ai des erreurs d'exécutions.

Le code que j'ai actuelle c'est ça :

uses
  Windows, [...]
TrafficUnit, IPHelper, IPHLPAP;
[...]
var
  Form1: TForm1;
  ActiveTraffic : TTraffic;
implementation

{$R *.dfm}

procedure TForm1.TimerTimer(Sender: TObject);
begin
  with ActiveTraffic do begin
    actuel_download.Caption := 'Download : ' + BytesToFriendlyString(InTotal);
    actuel_upload.Caption := 'Upload : ' + BytesToFriendlyString(OutTotal);
  end;
end;





Merci d'avance =D. (j'suis sur que j'ai encore fais une erreur à la c*n -_-")
0
eclems Messages postés 104 Date d'inscription samedi 23 décembre 2000 Statut Membre Dernière intervention 9 mai 2013
2 mai 2009 à 17:24
bonjours a tous ou avez vous eut ces unité

cordioalement
0
cs_Toshiiro Messages postés 9 Date d'inscription mardi 28 avril 2009 Statut Membre Dernière intervention 3 mai 2009
3 mai 2009 à 11:29
Salut -_-...

Eclems, c'est ici..!

Bref, il n'y aurait personne pour me filer un coup de pouce =''(. ?
Merci...
0
Rejoignez-nous