Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Obtaining network traffic info
How can I get the information about connection?




Bytes: Sent / Received

I found ... ntry603542
Use performance counters. Example should be somewhere in Resources -> first topic.

Look for class CPerformanceCounter.
performance counters depend of Network Interface name.

Is there any way to work in any computer?
Look in macro "WMI enum processes IDispatch", something similar.
In Win32_PerfRawData_Tcpip_NetworkInterface:

Is Timestamp_PerfTime the time of connection?

In affirmative case: how convert it to 0:00:00 format?
Don't know, look in MSDN.
Quote:In MSDN


Data type: uint64
Access type: Read-only

High Performance counter timestamp. A value could be obtained by calling the Windows function QueryPerformanceCounter. This property is inherited from Win32_Perf.

How convert it in 0:00:00?
Maybe it is system time as returned by QueryPerformanceCounter. Then use perf instead, as it returns more convenient value, number of microseconds.

If it is network time, use QueryPerformanceFrequency to convert it to microseconds, then divide...

Forum Jump:

Users browsing this thread: 1 Guest(s)