Capturing HTTP requests

前端 未结 6 1886
难免孤独
难免孤独 2020-12-14 05:09

Is there a way to monitor and capture all outgoing HTTP requests from a machine using C#?

I need a browser independent way of logging visited URLs.

6条回答
  •  清歌不尽
    2020-12-14 05:26

    Sounds like you're after some kind of "packet sniffing" utility.

    Here's a couple of links to articles on the Code Project site for packet sniffers (with downloadable source code) written in C#:

    Packet Capture and Analayzer

    A Network Sniffer in C#

    If you're just after capturing visited URL's, these utilities may be overkill, however, you'll be able to extract a URL from your HTTP packets and discard the rest, however, you may also wish to capture all packet information, in which case, these utilities will help.

提交回复
热议问题