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

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

问题描述

我有一个 c# win 应用程序.我在我的数据库中以 html 格式保存文本,但我想在 webbrowser 中向我的用户显示它.如何将字符串 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天全站免登陆