software you can take with you

Counting Total Bytes Sent/Received

Last post 07-12-2010 3:18 PM by PeterFoot. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 07-12-2010 9:14 AM

    Counting Total Bytes Sent/Received

    Good Afternoon, I have been searching for days for someway of doing this and getting very frustrated when someone pointed me in this direction. I have downloaded the trial and having a little play but still can't see how to get what I want.

     

    Basically I want to be able to display the total amount of data that has been sent and received (I don't care if its returned as bytes/kb/mb etc) But I just want an integer value how of much has been used but of the total device not 'my application'

     

    I know it is possible because I have found a similar app that does it (SPB Wireles) But it doesn't do exactly what we need so I have been given the task of making my own but I am struggling to find it. Can 'InTheHand' do what I want and if so how?

     

    Thanks,

    Max

  • 07-12-2010 3:18 PM In reply to

    Re: Counting Total Bytes Sent/Received

    The InTheHand.Net.NetworkInformation namespace has functionality to access network statistics on a per-adapter basis. e.g.

    using InTheHand.Net.NetworkInformation;

     

    NetworkInterface[ interfaces = NetworkInterface.GetAllInterfaces();

    //check the name properties to determine which interface to use

    IPv4InterfaceStatistics stats = chosenInterface.GetIPv4Statistics()

    int sent = stats.BytesSent;

    int received = stats.BytesReceived;

    //etc

     

    Peter

Page 1 of 1 (2 items)
Copyright © 2001-2013 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy. OrcsWeb's Windows Cloud Server Hosting