【问题标题】:Monitor a specific port with Performance Counter使用性能计数器监控特定端口
【发布时间】:2013-03-13 02:51:37
【问题描述】:

有什么方法可以使用性能计数器来监控所有流量,但在特定端口?

我在做:

GetCounterValue(_netRecvCounters[index], "Network Interface", "Bytes Received/sec", _instanceNames[index]):

double GetCounterValue(PerformanceCounter pc, string categoryName, string counterName, string instanceName)
    {
        pc.CategoryName = categoryName;
        pc.CounterName = counterName;
        pc.InstanceName = instanceName;
        return pc.NextValue();  
    }

但它似乎记录了所有内容

【问题讨论】:

    标签: c# performancecounter


    【解决方案1】:

    使用性能计数器,必须有人明确地向注册表提供每个计数器值。如果没有人提供您正在寻找的特定值作为输入,那么就无法将其取出。

    【讨论】:

    • 在没有性能计数器的情况下如何做到这一点?有没有其他办法?
    猜你喜欢
    • 2018-12-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-18
    • 2014-04-19
    • 2014-08-06
    • 2018-08-17
    • 2015-11-28
    相关资源
    最近更新 更多