Thank you,
Frank
"Frank" <b...@nospam.nospam> schreef in bericht
news:eCAYI%23WRGH...@TK2MSFTNGP10.phx.gbl...
Thanks,
Frank
"newbie" <as...@aswin.be> wrote in message
news:441451fc$0$14132$ba62...@news.skynet.be...
Have you checked the Win32_PerfFormattedData_Tcpip_NetworkInterface class?
There has some related properties to your question:
PacketsReceivedPerSec;
PacketsSentPerSec;
..
I suggest you can refer to the following Platform SDK documentation for the
details:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/
win32_perfformatteddata_tcpip_networkinterface.asp
Thanks!
Best regards,
Gary Chang
Microsoft Community Support
======================================================
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00
AM PST, February 14, 2006. Please complete a re-registration process by
entering the secure code mmpng06 when prompted. Once you have entered the
secure code mmpng06, you will be able to update your profile and access the
partner newsgroups.
======================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================
"Frank" <b...@nospam.nospam> schreef in bericht
news:OGE7g7fR...@TK2MSFTNGP11.phx.gbl...
I'm looking to capture the "total" number of packets "sent" and "received"
by the interface/adapter (not looking for per second counters). In Windows
2000/2003/XP if you open the properties of the network interface there is a
section called "activity" and shows the number of packets sent/received. I'm
looking to capture this information, i.e. cumulative total packets.
Where is the information for the adapter properties being pulled from?
Thank you,
Frank
""Gary Chang[MSFT]"" <v-ga...@online.microsoft.com> wrote in message
news:dmwpP$zRGHA...@TK2MSFTNGXA03.phx.gbl...
>Where is the information for the adapter properties being pulled from?
I am afraid I don't find a WMI class which provide the TX and RX packet
count you wants. But I know that data could be easily retrieved via the
networking API. The MIB_IFROW structure's member--dwInUcastPkts and
dwOutUcastPkts are the numbers of packets received and sent by a particular
interface:
MIB_IFROW
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mib/mib/mib
_ifrow.asp
There is a sample project in the Codeguru website which queries the
MIB_IFROW structure to get the MAC/NIC statistical information:
http://www.codeguru.com/cpp/i-n/network/networkinformation/article.php/c5437
/
To use that sample, you can add the following code snippet just after the
follwoing code snippet:
//Print out physical address ...line 78
printf( "%s\n", &macStr[0] );
//Insert code here:
printf( "Received Packets: %d\n", details.dwInUcastPkts );
printf( "Sent ackets: %d\n", details.dwOutUcastPkts );
..
(Note: That sample program needs the Platform SDK's Iphlpapi.h and
Iphlpapi.lib file )
Thanks for your understanding!
""Gary Chang[MSFT]"" <v-ga...@online.microsoft.com> schreef in bericht
news:bp0pg0$RGHA...@TK2MSFTNGXA03.phx.gbl...