Current time: 11-14-2018, 12:28 PM Stay in touch via Twitter Facebook RSS Feed
Ada Baiknya anda baca Peraturan Forum ForNesia Disini Dan Disitu Sebelum Terlambat!
System Registration Forums Mulai Kedepan Sewaktu waktu akan Di Tutup.
Silahkan Dibaca Mengenai Auto Pruning User . Agar tidak ada pertanyaan lagi tentang kehilangan akses forum.



menampilkan upload dan download Traffic pada project

12-25-2013 02:05 PM menampilkan upload dan download Traffic pada project
#1


suryadewa Away
NewBie
Administrators
*********

Posts: 341
Joined: Oct 2013

Reputation:

FCoin: 93.00ƒc
karena banyak yang bertanya di chat fb skrg biar gampang saya tulis disini aja sekalian .. langsung saja ..

[Image: updl.png]

yang dibutuhkan :

-2 label
-timer

ubah name label menjadi downText dan UploadText

lalu masukan code berikut pada var cari diatas {$R *.dfm}
lengkapnya

Code:
var
  Form1: TForm1;
  Download : Integer;
  Upload : Integer;

klik 2x pada timer dan masukan code dibawah

Code:
downText.Caption :=  FormatFloat('Down: ##0.## KB/s',download/1024);
UploadText.Caption :=  FormatFloat('Up: ##0.## KB/s',upload/1024);
download:= 0;
upload:= 0;


sisipkan code dibawah pada request dan respon

request :
Code:
upload:= upload+Length(AThread.NetData);

respons
Code:
download:= download+Length(AThread.NetData);

contoh lengkapnya seperti ini

Code:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPServer,
  IdMappedPortTCP;

type
  TForm1 = class(TForm)
    CP1: TIdMappedPortTCP;
    downText: TLabel;
    UploadText: TLabel;
    Timer: TTimer;
    procedure CP1Execute(AThread: TIdMappedPortThread);
    procedure CP1OutboundData(AThread: TIdMappedPortThread);
    procedure TimerTimer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  Download : Integer;
  Upload : Integer;

implementation

{$R *.dfm}

procedure TForm1.CP1Execute(AThread: TIdMappedPortThread);
begin
upload:= upload+Length(AThread.NetData);
end;

procedure TForm1.CP1OutboundData(AThread: TIdMappedPortThread);
begin
download:= download+Length(AThread.NetData);
end;

procedure TForm1.TimerTimer(Sender: TObject);
begin
  downText.Caption :=  FormatFloat('Down: ##0.## KB/s',download/1024);
  UploadText.Caption :=  FormatFloat('Up: ##0.## KB/s',upload/1024);
  download:= 0;
  upload:= 0;
end;

end.

http://www.suryadewa.com
02-18-2014 09:32 AM RE: menampilkan upload dan download Traffic pada project
#2


adi Away
FNS MEMBER
FNS Member
**

Posts: 96
Joined: Feb 2014

Reputation:

FCoin: 2.00ƒc
sangat bermanfaat. thanks

adi, proud to be a member of ForNesia Family since Feb 2014.
02-24-2014 02:57 PM RE: menampilkan upload dan download Traffic pada project
#3


adika Away
HunteR
HunteR
*

Posts: 80
Joined: Feb 2014

Reputation:

FCoin: 4.88ƒc
koq cuman tampil 0kb trus y,,
ndk jalan om,,

adika, proud to be a member of ForNesia Family since Feb 2014.
03-01-2014 01:09 PM RE: menampilkan upload dan download Traffic pada project
#4


smoz Away
Coding Moderators
Coding Moderators
*****

Posts: 78
Joined: Feb 2014

Reputation:

FCoin: 2.09ƒc
gan bagaimana mau buat meter digital sperti ini..


penampakan
Spoiler :

[Image: fornesia_2.gif]
03-02-2014 10:22 PM RE: menampilkan upload dan download Traffic pada project
#5


stupIDiot Away
HunteR
HunteR
*

Posts: 50
Joined: Feb 2014

Reputation:

FCoin: 2.00ƒc
nambah component lagi tuh om, digilabel

banyak kok, dari yg free sampe yg berbayar.

stupIDiot, proud to be a member of ForNesia Family since Feb 2014.
08-13-2014 06:05 AM RE: menampilkan upload dan download Traffic pada project
#6


zeph Away
FNS MEMBER
FNS Member
**

Posts: 272
Joined: Jun 2014

Reputation:

FCoin: 36.35ƒc
sangat bermanfaat mas infonya Smile

btw kalo di terapin di launcer bisa ndak yaa mas..??

VIDEO SSH | INFO SSH | DOWNLOAD ANIME | DOWNLOAD FILM

Sombong Dikit Gak Papa.... Penting Masih Selalu Lancar Aman Jaya Sentosa Sejahtera Suka Menabung wah




Possibly Related Threads...
Thread: Author Last Post
  Coding Menampilkan IP di Project suryadewa 04-28-2016 09:51 PM
Last Post: shenjai47
  Membuat Warna Trafik pada Project suryadewa 10-14-2015 06:54 PM
Last Post: raditya

Search thread:


[-]
Advertisement