Hi I am currently working on network monitoring system using SharpPcap. I am able to get the bytes from the network. But how do I convert these bytes into amount of data transfered through network, i.e. how much MB sent or MB received. I tried to look everywhere on internet but could not find a definite solution on how to do it.
Asked
Active
Viewed 150 times
0
-
Why don't you count the number of bytes you receive? – Robert Harvey May 23 '13 at 05:05
-
Actually I got it, instead of using OnPacketArrival event I am now using OnPcapStatistics event. We get one more property in the event handling method known as Statistics and then under Statistics we get RecievedBytes. which we can compute and and keep on adding to get the total number of bytes transfered. In my original questions by Bytes I meant Bytes[] (array). Sorry to confuse you. Still I am trying to compute what is upload and download. I think the better way to compute this is via the SourceAddress, if sourceaddress is same as the machine then it is upload. Just my assumption. – Dharmesh Tailor May 23 '13 at 05:36
-
1Please post your solution as an answer. – Bill the Lizard May 24 '13 at 13:00
1 Answers
0
Actually I got it, instead of using OnPacketArrival event I am now using OnPcapStatistics event. We get one more property in the event handling method known as Statistics and then under Statistics we get RecievedBytes. which we can compute and and keep on adding to get the total number of bytes transfered. In my original questions by Bytes I meant Bytes[] (array). Sorry to confuse you. Still I am trying to compute what is upload and download. I think the better way to compute this is via the SourceAddress, if sourceaddress is same as the machine then it is upload. Just my assumption.

Dharmesh Tailor
- 320
- 1
- 11