I have had two C++ classes now and have a decent amount of experience, but bear with me still.
I am trying to write code for a network monitor of sorts, initially in just C++ and then if I can get it to truly work, I'll utilize Visual C++.
Anyway, the only way that I can find to get current incoming and outgoing transfer information is by using the command line command "netstat -e".
C:\Documents and Settings\Jim>netstat -e
Bytes 153540201 7276711
Unicast packets 126359 85861
Non-unicast packets 173281 2197
Discards 0 0
Errors 0 0
Unknown protocols 4887
as DOS output. This command can be called in C++ by using
system("netstat -e") and the library <process.h>.
What I truly need is to store the received and sent bytes values from this output, but as of yet I haven't had any luck.
I have tried to store the output into a string, but only came out with a numerical value of 0, which I've read simply means the command was executed successfully.
I have also tried to send the output to a text file so that data can be taken from it, but I haven't had luck getting that to work either.
If anyone has any idea as to an easier way of getting network information, or of a way that information can be stored from a system output, it would be greatly appreciated.