2

我想获取 Windows 在给定时间点接收的打开 HTTP(TCP 端口 80)连接的总数。

.NET 中有什么方法可以得到这个吗?

我需要以某种方式查询IPGlobalProperties.GetActiveTcpConnections吗?

4

1 回答 1

4

为我工作:

var properties = IPGlobalProperties.GetIPGlobalProperties();
var httpConnections = (from connection in properties.GetActiveTcpConnections()
                       where connection.LocalEndPoint.Port == 80
                       select connection);
于 2012-05-16T05:12:56.400 回答