I am working on a Internet usage meter that calculate daily internet usage in pc. I was used below code to read data up and down.
NetworkInterface nic = nicArr[0]; //select internet connected Interface
IPv4InterfaceStatistics interfaceStats = nic.GetIPv4Statistics();
lblBytesReceived.Text = interfaceStats.BytesReceived.ToString(); //DOWNLOAD
lblBytesSent.Text = interfaceStats.BytesSent.ToString(); //UPLOAD
It is working well with a PC that not connected to a local network. But when it is working on computers that connected to local network, then byte transferred between local computers also added to internet usage.(If I copy files to network pc, then it also calculated) but I need to filter only data transferred for internet use. How can i do this ?