Windows phone的WebBrowser.Navigating事件表单数据 [英] Windows phone WebBrowser.Navigating event form data

查看:119
本文介绍了Windows phone的WebBrowser.Navigating事件表单数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我添加了一个处理程序WebBrowser.Navigating事件,发现它也被解雇了POST请求。在这种情况下e.Uri等于网页的当前URL,但似乎没有任何办法来获得POST请求的表单数据。

I have added a handler to WebBrowser.Navigating event and noticed it's being fired also for POST requests. In this case e.Uri is equal to the current Url of the page but there doesn't seem to be any way to get POST request form data.

    void browser_Navigating(object sender, NavigatingEventArgs e)
    {
        var url = e.Uri;
        // there is not something e.Form available here...
    }

难道你们有什么想法,这怎么可能?

Do you guys have any idea how is this possible?

推荐答案

根据我最近读过,获得了Request和Response对象是不可能的WP7 web浏览器出于同样的原因作为完整的框架。基本上,它从未付诸实施。

Based on what I've read recently, access to the Request and Response objects is not possible with WP7 WebBrowser for the same reason as the full framework. Basically it was never implemented.

这理论上可以用于访问表格数据的一种技术是使用一个本地代理的拦截请求。我相信这需要使用WP7上的低水平插槽服务器。这是可行的但我不知道它是否有可能以编程方式更改手机代理地址,因为我曾经尝试过。

One technique that can theoretically be used to access the form data is the use of a local proxy to intercept requests. I believe this requires the use of a low level socket server on WP7. This is feasible however I'm not sure on whether it's possible to change the phone proxy address programmatically as I've ever attempted it.

其实多一个选择。我只是碰到<少时href=\"http://social.msdn.microsoft.com/Forums/en-US/windowsphone7series/thread/2946ad89-fb50-4ccf-898c-b4c5c7a12b54/\"相对=nofollow>这个,显然可以使用<一个href=\"http://msdn.microsoft.com/en-us/library/microsoft.phone.controls.webbrowser.savetostring%28v=VS.92%29.aspx\"相对=nofollow> SaveToString 来保存当前文档(在导航)。这将允许您解析表单数据提交表单之前。

Actually one more option. I just came across this, apparently you can use SaveToString to save the current document (on navigating). This would allow you to parse the form data just before the form is submitted.

这篇关于Windows phone的WebBrowser.Navigating事件表单数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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