Re: [問題] web的網路流量統計

看板C_Sharp (C#)作者時間18年前 (2007/01/09 00:40), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
※ 引述《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
文章代碼(AID): #15edGNpH (C_Sharp)
討論串 (同標題文章)
文章代碼(AID): #15edGNpH (C_Sharp)