看板 C_Sharp 關於我們 聯絡資訊
Windows NT裡面有個utility叫做Performance, 它可以監看local或是network上電腦的各種performance counter, 當然包括了network performance. 因此我的想法是直接用它來監看network performance. 實際上的做法大概是這樣. 1. 在Toolbox -> Component裡面有一個PerformanceCounter, 用drag-n-drop 把它加入到window / web form裡頭. 2. 在那個PerformanceCounter的properties裡面, 選擇你要監看的種類. 這邊就假設是要監看某個網路介面的流出流量. Category Name選Network Interface, CounterName選Bytes Sent / sec, InstanceName選要監看的那個網路介面. 如果要監看網路上的其他電腦的performance, 就在MachineName那兒指定. 3. 用PerformanceCounter.NextValue這個method來讀取calculated value, 用PerformanceCounter.RawValue這個property來讀寫raw value. 簡單來講就是這樣, 細節看看.NET Framework SDK吧. Performance功能是狠強大的, 之前看過有個tutorial用ASP.NET做了個web based的Performance Counter. -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 210.68.184.96
Killertcell:十分感謝~~~ 找到一個方向研究了^^ 220.134.83.229 12/18