AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi Netzwerkauslastung / Traffic

Netzwerkauslastung / Traffic

Ein Thema von Billi Berserker · begonnen am 15. Apr 2003 · letzter Beitrag vom 5. Jan 2009
 
Benutzerbild von Calimero
Calimero

Registriert seit: 8. Mär 2003
Ort: Krefeld
69 Beiträge
 
Delphi 6 Personal
 
#6

Re: Netzwerkauslastung/Traffic

  Alt 25. Aug 2003, 08:23
IP Headers saugen

hier ein beispiel (Zeigt mir den den Traffic der ersten Netzwerkkarte):

Delphi-Quellcode:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,Winsock,
  IpExport,
  IpHlpApi,
  IpTypes,
  IpIfConst,
  IpRtrMib, ExtCtrls;

type
  TForm1 = class(TForm)
    Timer1: TTimer;
    Memo1: TMemo;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    procedure Timer1Timer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;


implementation

{$R *.dfm}



procedure TForm1.Timer1Timer(Sender: TObject);
var MibRow: TMibIfRow;
IntfTable: PMibIfTable;
Size: DWORD;
I: Integer;
begin
Size := 0;
 if GetIfTable(nil, Size, True) <> ERROR_INSUFFICIENT_BUFFER then Exit;
  IntfTable := AllocMem(Size);
  try
    if GetIfTable(IntfTable, Size, True) = NO_ERROR then
    begin
      for I := 0 to IntfTable^.dwNumEntries - 1 do
      begin
     {$R-}MibRow := IntfTable.Table[I];{$R+}
        if MibRow.dwType <> MIB_IF_TYPE_ETHERNET then Continue; // oder MIB_IF_TYPE_PPP
       if i = 1 then begin // Welche Verbindung

       label2.caption := inttostr(MibRow.dwInOctets);
        label4.Caption := inttostr(MibRow.dwOutOctets);
                     end;
  end;
    end;


    finally
    FreeMem(IntfTable);
  end;
end;

end.
[edit=sakura] [delphi]tags Mfg, sakura[/edit]
***** I like Delphi & Rapidq and C *****
  Mit Zitat antworten Zitat
 

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:54 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz