네트워크 트래픽 체크

C# RSS Icon ATOM Icon 2012/07/10 10:19 visualp
[원문]http://www.dotnetspider.com/resources/5478-How-Show-Network-Traffic-using-C-dot.aspx



private static void ShowNetworkTraffic()
{
    PerformanceCounterCategory performanceCounterCategory = new PerformanceCounterCategory("Network Interface");
    string instance = performanceCounterCategory.GetInstanceNames()[0]; // 1st NIC !
    PerformanceCounter performanceCounterSent = new PerformanceCounter("Network Interface", "Bytes Sent/sec", instance);
    PerformanceCounter performanceCounterReceived = new PerformanceCounter("Network Interface", "Bytes Received/sec", instance);

    for (int i = 0; i < 10; i++)
    {
        Console.WriteLine("bytes sent: {0}k\tbytes received: {1}k", performanceCounterSent.NextValue() / 1024, performanceCounterReceived.NextValue() / 1024);
        Thread.Sleep(500);
    }
}
2012/07/10 10:19 2012/07/10 10:19
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.visualp.com/rss/response/477

댓글+트랙백 ATOM :: http://blog.visualp.com/atom/response/477

트랙백 주소 :: 이 글에는 트랙백을 보낼 수 없습니다

트랙백 RSS :: http://blog.visualp.com/rss/trackback/477

트랙백 ATOM :: http://blog.visualp.com/atom/trackback/477