[python-win32] Getting Network Information/Statistics

>.> twopill at gmail.com
Thu Jan 24 01:55:24 CET 2008


----- Original Message ----- 
Tim Roberts wrote:

> Now, you know that "Current Bandwidth" is not what you want, right?
> This just shows it is a 100Mbit connection.

Yes I am, win32pdhutil.browse() won't report anything for Bytes Received, 
Sent, or Total so I used Current Bandwidth.

> It's a 32-bit unsigned value that is printed as a signed value, so the
> minus sign is important.  From Python, try
>    hex(2**32 - 1073738810)
> You'll find it is C0000BC6, which is PDH_INVALID_DATA.

Ah, thanks.

> Perhaps Microsoft change the counter name in some way in Vista

win32pdh.EnumObjectItems(None, None, 'Network Interface')
Shows them as the same.



More information about the python-win32 mailing list