如何将rtf转换为HTML格式或将xaml转换为HTML格式。

如何将rtf转换为HTML格式或将xaml转换为HTML格式。

问题描述:

你好



我在wpf C#中使用Rich文本框(正文)发送邮件



我想要将确切的内容发送给用户(维护样式),因为我必须将富文本框的内容转换为html格式,我该怎么做同样的帮助。





问候



我尝试过:



我在网上尝试了各种解决方案但是没有帮助。

Hello

I am using Rich text box(body) in wpf C# to sent a mail

I want exact content to be sent to user(maintaing style)for that I have to convert content of rich text box to html format ,How can i do the same pls help.


Regards

What I have tried:

I have tries u various solution online but failed pls help.

这应该是一个很好的起点:

编写自己的RTF转换器 [ ^ ]



看起来您可以覆盖方法以转换为您的首选格式。



一个建议是你首先要设计HTML代码想要邮件看起来像。然后你有一个模板,用于填写RichTextBox中的信息。
This should be a good starting point:
Writing Your Own RTF Converter[^]

It seems like you can override methods in order to convert to your preferred format.

One recommendation is that you first design HTML code for how you want the mail to look like. Then you have a template for how to fill in the information from the RichTextBox.