作者deduce ()
看板C_Sharp
标题Re: [问题] web的网路流量统计
时间Tue Jan 9 00:40:52 2007
※ 引述《taoko (春秋两不沾)》之铭言:
: as title, 我想写一个像计中可以统计每天的流出与流进的位元组
: (也就像左下角工具列的区路网路中的位元组统计)
: 我知道应该要用IPGlobalStatistics 的类别库
: 可是详细的function请问是什麽?
: 感激不尽
using System.Net.NetworkInformation;
public static void ShowInboundIPStatistics()
{
IPGlobalProperties 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);
}
--
这是MSDN提供的sample code..
我直接用你给的 IPGlobalStatistics 马上就找到答案了
建议你下次可以自己先试着找找看
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.119.232.160