AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi Problem bei code umformung für netzwerk auslastung
Thema durchsuchen
Ansicht
Themen-Optionen

Problem bei code umformung für netzwerk auslastung

Ein Thema von G G · begonnen am 18. Jul 2004 · letzter Beitrag vom 21. Jul 2004
 
G G

Registriert seit: 17. Jun 2004
192 Beiträge
 
#1

Problem bei code umformung für netzwerk auslastung

  Alt 18. Jul 2004, 09:57
Hi, ich habe in dem forum folgenden code gefunden, um die download geschwindigkeit zu errechnen. Nur jetzt bin ich absolut nicht in der lage diesen code so umzuformen dass er den upload speed anzeigt. Ich habe probiert einfach alle "MibRow.dwInOctets" in "MibRow.dwoutOctets" umzuschrieben, aber nun zeigt er so gut wie immer 0 an.
Dieser code benötigt noch bestimmte IP Headers "http://www.delphipraxis.net/internal_redirect.php?t=4548&highlight=mibrow+dwou toctets"

nun der code in der download form, kann mir da jemand tipps geben wie ich das richtig mache?

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;
    Label1: TLabel;
    procedure Timer1Timer(Sender: TObject);


  private
    { Private declarations } 
  public
    { Public declarations } 
  end;

var
  Form1: TForm1;
  old: integer;

implementation

{$R *.dfm} 

procedure TForm1.Timer1Timer(Sender: TObject);
var MibRow: TMibIfRow;
IntfTable: PMibIfTable;
Size: DWORD;
I: Integer;
wert: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
       wert := MibRow.dwInOctets - old;


                      label1.caption := floattostr(round(Wert /1024 *100)/100) + ' KB/s';
                     old := MibRow.dwInOctets

                     end;
  end;
    end;


    finally
    FreeMem(IntfTable);
  end;

end;


end.
  Mit Zitat antworten Zitat
 


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 16:58 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz