WPF的web浏览器 [英] WPF-WebBrowser

查看:135
本文介绍了WPF的web浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我想通过网络登录Facebook b< g class =" gr_ gr_5 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace"数据-GR-ID =" 5英寸ID = << 5"> rowser< / g取代;在WPF应用程序中,但是有一个
的问题。

Hello, I want to login facebook via web b<g class="gr_ gr_5 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="5" id="5">rowser</g> in WPF application but there's a problem.

图片链接:https://i.hizliresim.com/JQAJ4W.png

Image Link : https://i.hizliresim.com/JQAJ4W.png

推荐答案

如果您使用WPF webBrowser而不是Winform。

If you use WPF webBrowser not Winform.

您可以尝试将文档类型转换为System.Windows.Forms.HtmlDocument,如下代码所示。

You can try to convert the type of Document to System.Windows.Forms.HtmlDocument as following code.

   System.Windows.Forms.HtmlDocument document = (System.Windows.Forms.HtmlDocument)webBrowser.Document;
   document.getElementById("email");

您还可以 将  Document的类型转换为mshtml.HTMLDocument,如下代码所示。

You can also  convert the type of Document to mshtml.HTMLDocument as following code.

mshtml.HTMLDocument document = (mshtml.HTMLDocument)WebBrowser1.Document;
mshtml.IHTMLElement textArea = document.getElementById("email");


 

最好的问候,

 

Best Regards,

Bob


这篇关于WPF的web浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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