Variables available:
NetStats.Adaptername0 Adapter name
NetStats.MTU0 Adapter MTU
NetStats.Speed0 Adapter theoretical speed
NetStats.TotalDownload0 Adapter total download
NetStats.TotalUpload0 Adapter total upload
NetStats.DownloadSpeed0 Adapter current download speed
NetStats.UploadSpeed0 Adapter current upload speed
By changing the number at the end of variable you can get statistics for different adapters on the system. All found network interfaces are listed to log.txt.
All info is read from this struct so if there's need more variables could be added.
Code:
typedef struct _MIB_IFROW {
WCHAR wszName[MAX_INTERFACE_NAME_LEN];
DWORD dwIndex; // index of the interface
DWORD dwType; // type of interface
DWORD dwMtu; // max transmission unit
DWORD dwSpeed; // speed of the interface
DWORD dwPhysAddrLen; // length of physical address
BYTE bPhysAddr[MAXLEN_PHYSADDR]; // physical address of adapter
DWORD dwAdminStatus; // administrative status
DWORD dwOperStatus; // operational status
DWORD dwLastChange; // last time operational status changed
DWORD dwInOctets; // octets received
DWORD dwInUcastPkts; // unicast packets received
DWORD dwInNUcastPkts; // non-unicast packets received
DWORD dwInDiscards; // received packets discarded
DWORD dwInErrors; // erroneous packets received
DWORD dwInUnknownProtos; // unknown protocol packets received
DWORD dwOutOctets; // octets sent
DWORD dwOutUcastPkts; // unicast packets sent
DWORD dwOutNUcastPkts; // non-unicast packets sent
DWORD dwOutDiscards; // outgoing packets discarded
DWORD dwOutErrors; // erroneous packets sent
DWORD dwOutQLen; // output queue length
DWORD dwDescrLen; // length of bDescr member
BYTE bDescr[MAXLEN_IFDESCR]; // interface description
} MIB_IFROW,*PMIB_IFROW;