Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/proc/net/dev alternative on Windows

I have a program in C that reads /proc/net/dev and parses the number of bytes downloaded and uploaded. I use it to show notifications when I'm about to cross certain threshold and to keep statistics of download/upload.

My question is, how do I make this work on Windows as well? Is there any file with the same function as /proc/net/dev on Unix systems?

Or how do I get number of bytes transferred since boot on Windows? Thanks.

like image 917
lsrom Avatar asked Feb 01 '26 14:02

lsrom


1 Answers

In your C program you could do something such as system('netstat -e') and parse the results. Other netstat options may help for this type of thing as well.

like image 167
h0r53 Avatar answered Feb 03 '26 05:02

h0r53



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!