Get current network usage (upload/download)?

Just starting out? Need help? Post your questions and find answers here.
novablue
Enthusiast
Enthusiast
Posts: 165
Joined: Sun Nov 27, 2016 6:38 am

Get current network usage (upload/download)?

Post by novablue »

Hello, i am looking for a way to read out the current upload/download network usage on the system. Something like a network meter does.
User avatar
Mijikai
Addict
Addict
Posts: 1360
Joined: Sun Sep 11, 2016 2:17 pm

Re: Get current network usage (upload/download)?

Post by Mijikai »

I think u could use GetAdaptersAddresses() https://docs.microsoft.com/de-de/window ... dfrom=MSDN
It returns a list of IP_ADAPTER_ADDRESSES structures.

Contained are those fields:

Code: Select all

ULONG64 TransmitLinkSpeed;
ULONG64 ReceiveLinkSpeed;
Its the current speed (up-/download) in bits per second.
I hope this works (convert the structure and import the function).
novablue
Enthusiast
Enthusiast
Posts: 165
Joined: Sun Nov 27, 2016 6:38 am

Re: Get current network usage (upload/download)?

Post by novablue »

I am still not having any luck, Could a more experienced user make an example for it?
Axolotl
Enthusiast
Enthusiast
Posts: 435
Joined: Wed Dec 31, 2008 3:36 pm

Re: Get current network usage (upload/download)?

Post by Axolotl »

Hi novablue,

you can search for 'IP_ADAPTER_ADDRESSES' on this forum and you will find a lot of sample codes.
Just the first to items I got on my search ...
viewtopic.php?f=13&t=67182&p=517038&hil ... ES#p517038
viewtopic.php?f=12&t=60322&p=498133&hil ... ES#p498133

Happy coding and stay healthy.
Mostly running PureBasic <latest stable version and current alpha/beta> (x64) on Windows 11 Home
Post Reply