-1

ネットワーク カードの送受信パケット数 (IP レベル : TCP、UDP などを含む) に関する統計を取得したい。

Windows からその情報を照会するにはどうすればよいですか?

4

3 に答える 3

0

WMI。

C# から使用するのは簡単ではありませんが、可能です。

必要なクラスのドキュメントは次の場所にあります

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_perfformatteddata_tcpip_networkinterface.asp

于 2012-12-25T07:35:17.713 に答える
0

まずあなたが持っている

using System.Net.NetworkInformation;

次にあなたが持っている:

var iFaceArr = NetworkInterface.GetAllNetworkInterfaces();
NetworkInterface iface = iFaceArr[0];
IPv4InterfaceStatistics iFaceStats = iface.GetIPv4Statistics();

次に、これらの変数があります。

iFaceStats.UnicastPacketsReceived;
iFaceStats.UnicastPacketsSent;
iFaceStats.NonUnicastPacketsReceived;
iFaceStats.NonUnicastPacketsSent;

参照

于 2013-01-08T06:49:16.267 に答える
-1

Pcap.Netをご覧ください。

Getting the list of Live Devices on the local host.
Reading packets from Live Devices (Network Devices) and Offline Devices (Files) using the different WinPcap methods.
Receiving statistics on the entire capture.
Receiving statistics of packets instead of the full packets.
Using different sampling methods.
Applying Berkley Packet Filters.
Sending packets to Live Devices directly or using WinPcap's send queues.
Dumping packets to Pcap files.
Using Enumerables to receive packets (and LINQ).

winpcap ドライバーをシステムにインストールする必要があることに注意してください。

于 2012-12-25T07:32:55.743 に答える