Solved

Getting the bytes transfered from a machine

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

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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month8 days, 15 hours left to enroll

617 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