Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Getting the bytes transfered from a machine

Posted on 2001-08-03
2
272 Views
Last Modified: 2010-04-06

Hai experts,

  How will we calculate the the amount of bytes transfered from a machine using a delphi application.

Can you send me an application which can be used for this purpose?
0
Comment
Question by:mrk_raj
2 Comments
 
LVL 3

Expert Comment

by:rondi
ID: 6347922
Could you elaborate...

Data passed between your own apps on different machines ?
 - easily done
Data passed between ANY apps ?
 - possible, but complex - you might have to write a
   sniffer or look into Winsock SPI - check out whatis.com

rondi.
0
 
LVL 14

Accepted Solution

by:
DragonSlayer earned 50 total points
ID: 6348312
If you need a packet sniffer, you could try WinPCap

http://netgroup-serv.polito.it/winpcap/ 

Here's the URL to the Delphi header translations:

http://home1.stofanet.dk/nitezhifter/files/Delphi%20Pcap.zip


And an example code is as follows (by Smurff, in my PAQ):

unit Unit1;

interface

uses
 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
 StdCtrls,Zniffer, ExtCtrls;

type
 TForm1 = class(TForm)
   Panel1: TPanel;
   Button1: TButton;
   ComboBox1: TComboBox;
   Memo1: TMemo;
   procedure FormCreate(Sender: TObject);
   procedure ComboBox1Change(Sender: TObject);
 private
   { Private declarations }
   FZniffer : TZniffer;
   procedure ReadPacket(Data:pointer;recvbytes:Word);
 public
   { Public declarations }
 end;

var
 Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
Fzniffer := TZniffer.create;
Fzniffer.OnPacket := ReadPacket;
Combobox1.Items.assign(Fzniffer.Adapters);
Combobox1.text:='< SELECT ADAPTER >';

end;

procedure TForm1.ComboBox1Change(Sender: TObject);
var E:string;
begin
 if Fzniffer.Snooping then
   if not Fzniffer.Deactivate(E) then  raise Exception.create(e);
 Fzniffer.AdapterIndex := COmbobox1.ItemIndex;
 if not Fzniffer.Activate(e) then raise Exception.create(e);
end;

procedure TForm1.ReadPacket(Data: pointer; recvbytes: Word);
begin
 memo1.Lines.add('Packet snooped. Bytes: '+inttostr(recvbytes) );
end;

end.

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question