如何将html页面存储在xml文件中? [英] How do I store html page in a xml file?
问题描述
我有一个用c#编写的小应用程序作为我想用来发送电子邮件的控制台应用程序。我计划将电子邮件存储在一个xml文件中以及消息将像主题一样需要的其他信息。然而,似乎有一个问题,因为XML文件不像< / br>
字符。
I have a small application written in c# as a console app that I want to use to send an email. I was planning on storing the email inside an xml file along with other information that the message will need like a subject. However there seems to be a problem because the XML file doesnt like </br>
characters.
我想知道为了存储html电子邮件我应该做什么,我只需要在一个单独的html文件中键入body html,然后将每行读入StreamReader对象?
Im wondering what I should do in order to store a html email do I just have to keeo the body html in a seperate html file and then read each line into a StreamReader object?
推荐答案
最简单的方法是将HTML内容存储在 CDATA部分:
The easiest way would be to store the HTML content in a CDATA section:
<mail>
<subject>Test</subject>
<body>
<![CDATA[
<html>
...
</html>
]]>
</body>
</mail>
这篇关于如何将html页面存储在xml文件中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!