How can I programatically get internet traffic fro

2019-08-18 02:21发布

How do I programatically get internet traffic from a web site in C# or C++?

I mean, how can this be done without opening up a browser or a broswer control?

Additionally, there is some sort of plugin to a browser in IE and others where you can watch the communication from a browser to a server and back. Does anyone know about this?

5条回答
贼婆χ
2楼-- · 2019-08-18 03:03

If you are looking for programmaticaly requesting web pages then you might check httpwebrequest in C#.

Additionally, there is some sort of plugin to a browser in IE and others where you can watch the communication from a browser to a server and back. Does anyone know about this?

you can check fiddler.

查看更多
女痞
3楼-- · 2019-08-18 03:05

WebClient and HttpWebRequest can be used to communicated with servers without a browser

http://msdn.microsoft.com/en-au/library/system.net.webclient(VS.80).aspx

http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx

Fiddler can be used to watch the browser communication

http://www.fiddler2.com/fiddler2/version.asp

查看更多
你好瞎i
4楼-- · 2019-08-18 03:17

Use the WebClient.DownloadString() or DownloadStringAsync() with the address of the web site.

查看更多
聊天终结者
5楼-- · 2019-08-18 03:17

You can use System.Net.HttpWebRequest, which lets you send http get and http post requests.

查看更多
叛逆
6楼-- · 2019-08-18 03:28

Look into cURL for C++ http://curlpp.org/ or if you want more low-level communication processing check socket programming and winsock. You'll connect to a server on a port and send a GET request, the server will respond with the HTML code if the page is an HTML, etc.

You will have to have some basic HTTP protocol knowledge though. http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol

查看更多
登录 后发表回答