我如何提取/插入文字在C#中的RTF字符串 [英] How do I extract/insert text into RTF string in C#

查看:425
本文介绍了我如何提取/插入文字在C#中的RTF字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个C#控制台应用程序我有需要解压从RTF字符串文本,添加一些文字,然后将其转换回RTF。我已经能够做到这一点使用System.Windows.Forms.RichTextBox类,但我觉得有点奇怪在非窗体应用程序中使用一个窗体控件。 ?没有更好的办法来做到这一点。

In a C# console app I have the need to extract the text from an RTF string, add some more text to it, and then convert it back into RTF. I have been able to do this using the System.Windows.Forms.RichTextBox class, but I find it a bit odd to use a Forms control in a non-Forms app. Any better way to do this?

推荐答案

请参阅有关该主题的讨论:

Please see discussion on this topic:

http://stackoverflow.com/questions/20450/cleaning-up-rtf-text

这篇关于我如何提取/插入文字在C#中的RTF字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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