webBrowser.Document.Write()不规则性能 [英] webBrowser.Document.Write() Irregular Performance

查看:130
本文介绍了webBrowser.Document.Write()不规则性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用WebBrowser控件作为主要的输出窗口,我的应用程序。我第一次使用的document.write(),文本将被完全取代。第二次是我写的文字被追加到末尾。我证实,我不写两次或意外增加​​弦太多次。为什么要控制行为这种方式?

I am using a webBrowser control as the main output window for my application. The first time I use document.write(), the text is completely replaced. The second time the text that I am writing is appended to the end. I have confirmed that I am not writing twice or adding strings too many times by accident. Why would the control behave this way?

推荐答案

呼叫的 OpenNew 写文档之前。

HtmlDocument doc = webBrowser1.Document.OpenNew(true);
doc.Write("<HTML><BODY>This is a new HTML document.</BODY></HTML>");

这篇关于webBrowser.Document.Write()不规则性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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