Solved

Getting the bytes transfered from a machine

Posted on 2001-08-03
2
274 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
[X]
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
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

751 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