Solved

Getting the bytes transfered from a machine

Posted on 2001-08-03
2
273 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

Industry Leaders: 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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

749 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