C#窗口格式中的RTF文本框 [英] Rich Text Box in C# window Form

查看:274
本文介绍了C#窗口格式中的RTF文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将HTML代码转换为rtf代码以编程方式显示在Rich Text Box中?

如果用户提供HTML代码,它将如何显示回富文本框?有任何建议吗?

How can transform HTML code to rtf Code to display in Rich Text Box programmatically?

If the user give HTML code and how can it show back to rich text box ? Any suggestions ?

推荐答案

这是一种商业产品,但它可能正是您所需要的: ^ ].

为了获得更准确的答案,您可能需要考虑用ASP.net或WinForm标记问题.

干杯,
This is a commercial product, but it might be just what you were looking for: http://cutesoft.net/example/editRTF.aspx[^].

To get preciser answers you might want to consider tagging your question either ASP.net or WinForm.

Cheers,


我不喜欢商业产品来完成这项任务,不仅仅是因为钱,更是因为它是封闭代码.

您可以自己学习如何做.查看此CodeProject文章:编写自己的RTF转换器 [
I don''t like commercial product for this task, and not just because of money, more because it is closed code.

You can learn how to do it by yourself. Look at this CodeProject article: Writing Your Own RTF Converter[^].

Now, I would advice you do now allow the user to post all thinkable HTML code. More exactly, you could filter out all tags except some limited set you allow in your document. It will make conversion to RTF easy and will add some safety to your site.

Alternatively, I would recommend keeping all the documents in HTML (better yet, XHTML) without using RTF. HTML is much better suited for Web applications.

—SA


这篇关于C#窗口格式中的RTF文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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