
02.01.2014, 18:43
|
Прохожий
|
|
Регистрация: 29.12.2013
Сообщения: 5
Версия Delphi: Delphi 7
Репутация: 10
|
|
Подскажите что не так?
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IPHelper, IpHlpApi, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Timer1: TTimer;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
zero,i : Real;
InDowm, InOut, Resul: string;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var MibArr : IpHlpAPI.TMIBIfArray;
begin
Get_IfTableMIB(MibArr);
zero:=MibArr[1].dwInOctets;
//i:=MibArr[0].dwOutOctets;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
MibArr : IpHlpAPI.TMIBIfArray;
begin
Get_IfTableMIB(MibArr);
InDowm:= FloatToStr(MibArr[17].dwInOctets);
InOut:= FloatToStr(MibArr[17].dwOutOctets);
Resul:=InDowm+InOut;
Label1.Caption:=InDowm;
Label2.Caption:=InOut;
//Label3.Caption:='Весь трафик: '+ Resul;
end;
end.
|