有没有简单的方法从Rtf字符串中提取文本而不使用RichTextBox?如何将rtf字符串转换为C#中的文本
例子:
{\rtf1\ansi\ansicpg1252\uc1\htmautsp\deff2{\fonttbl{\f0\fcharset0 Times New Roman;}{\f2\fcharset0 Segoe UI;}}{\colortbl\red0\green0\blue0;\red255\green255\blue255;}\loch\hich\dbch\pard\plain\ltrpar\itap0{\lang1033\fs18\f2\cf0 \cf0\ql{\f2 {\lang2070\ltrch foo}\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\lang2070\ltrch bar }\li0\ri0\sa0\sb0\fi0\ql\par}
}
}
应该返回:
foo
bar
你真的意味着“不使用RichTextBox的”还是你的意思,而“不CodeProject上的样本显示一个RichTextBox“?不使用RichTextBox的 – Heinzi 2011-04-12 11:44:58
。这将在一个由报告服务器加载的dll上。如果它包含windows.forms – dcarneiro 2011-04-12 11:46:54