捕获从网络浏览器控制所有的请求和响应? [英] Capturing all requests and responses from the web browser control?

查看:580
本文介绍了捕获从网络浏览器控制所有的请求和响应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有方式来捕捉并打印出所有从网络浏览器控制,包括异步请求的请求和响应的?

Is there way to capture and print out all of the requests and responses from the web browser control including asynchronous requests?

推荐答案

你有没有想过使用提琴手的?他们甚至有一个 API ,你可能能够使用这一点。

Have you thought about using Fiddler? They even have an API that you might be able to use for this.

修改

您可以尝试使用<一个href="http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.navigated.aspx">Navigated事件或<一href="http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.loadcompleted.aspx">LoadCompleted事件中获取响应信息。你也许可以使用<一个href="http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.navigating.aspx">Navigating事件了解请求信息。这些事件可能与异步请求发生,但我不知道这一点。

You can try using the Navigated event or LoadCompleted event for getting response information. You might be able to use the Navigating event for request information. These events might occur with async requests, but I'm not sure on that.

编辑反击

嗯,我没有使用上述事件的一些测试,我怕我什么也没得到。这些事件并没有给我什么,我可以用。即使他们能够获得WebResponse类和WebRequest的,他们总是什么/空在我的测试。

Well I did some testing using the above events, and I'm afraid I got nothing. The events were not giving me anything that I could use. Even though they had access to webresponse and webrequest, they were always nothing/null in my testing.

我觉得可悲的现实是,Web浏览器控件的目的不是为了使用你想要的方式。这只是对网页服务/数据并没有提供您的访问调查数据。我认为他们这样做是为C.Y.A.从制作恶意软件/间谍软件的浏览器衡量prevent人。

I guess the sad reality is that the web browser control was not intended to be used the way you want. It's just for serving web pages/data and does not provide you the access to look into the data. I think they did it as a C.Y.A. measure to prevent someone from making a malware/spyware browser.

您最好的选择将是连接使用Fiddler Web浏览器(或其他一些'嗅'库)。

Your best bet is going to be coupling the web browser with fiddler (or some other 'sniffing' library).

这篇关于捕获从网络浏览器控制所有的请求和响应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆