简体   繁体   English

如何监视.NET中的传出HTTP连接?

[英]How to monitor outgoing HTTP connections in .NET?

How does one log all outgoing HTTP connections in .NET from a Windows 7 computer? 如何从Windows 7计算机记录.NET中的所有传出HTTP连接? I can see the connections in Fiddler, but I want my own program to log those connections. 我可以在Fiddler中看到连接,但是我希望自己的程序记录这些连接。

I found IPGlobalProperties.GetActiveTcpConnections . 我发现了IPGlobalProperties.GetActiveTcpConnections But that requires polling. 但这需要轮询。 Is there a better way? 有没有更好的办法?

There are many ways. 有很多方法。

Fiddler is one. 提琴手就是其中之一。

System.net tracing is another. System.net跟踪是另一个。 I suggest you use implement your own trace writer and you get all information coming to you to log. 我建议您使用自己的跟踪编写器来实现,并获取所有要记录的信息。

System.net tracing does not store all the data, only the first 1024 bytes. System.net跟踪不存储所有数据,仅存储前1024个字节。

执行fiddler2的操作:实施分层服务提供程序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM