如何显示字符串的HTML内容到WebBrowser控件? [英] How to display the string html contents into webbrowser control?

查看:222
本文介绍了如何显示字符串的HTML内容到WebBrowser控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个C#应用程序双赢方案。我保存在我的数据库的HTML格式的文本,但我想在一个网页浏览器来显示它我user.How来显示字符串HTML内容到WebBrowser控件?

I have a c# win app program. I save the text with html format in my database but I want to show it in a webbrowser to my user.How to display the string html contents into webbrowser control?

在此先感谢

推荐答案

试试这个:

webBrowser1.DocumentText =
    "<html><body>Please enter your name:<br/>" +
    "<input type='text' name='userName'/><br/>" +
    "<a href='http://www.microsoft.com'>continue</a>" +
    "</body></html>";

这篇关于如何显示字符串的HTML内容到WebBrowser控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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