WPF的web浏览器 [英] WPF-WebBrowser
问题描述
您好,我想通过网络登录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屋!