日期:2014-05-18  浏览次数:21304 次

C#中怎么获取本机当前的网络流量?
我查了一下,看着System.Net.NetworkInformation;这里面的方法有点像,但一直没有找到网络流量,大家帮忙看一下,先谢了。

------解决方案--------------------
PGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
IPGlobalStatistics ipstat = properties.GetIPv4GlobalStatistics();
Console.WriteLine( " Inbound Packet Data: ");
Console.WriteLine( " Received ............................ : {0} ",
ipstat.ReceivedPackets);
Console.WriteLine( " Forwarded ........................... : {0} ",
ipstat.ReceivedPacketsForwarded);
Console.WriteLine( " Delivered ........................... : {0} ",
ipstat.ReceivedPacketsDelivered);
Console.WriteLine( " Discarded ........................... : {0} ",
ipstat.ReceivedPacketsDiscarded);
------解决方案--------------------
【翻译】网络性能监视器
http://bbs.msproject.cn/Default.aspx?g=posts&t=63