我有以下格式的 XML
<Attachment>
<AttachmentName>Top Nav Menu.docx</AttachmentName>
<Subject>Attachment1</Subject>
<Sender>JameelM@orioninc.com</Sender>
</Attachment>
我想在附件关闭节点之后附加另一个附件,如上所述。以下是我为编写 xml 文件而编写的代码
var doc = new XDocument(
new XDeclaration("1.0", "utf-16", "true"),
new XProcessingInstruction("test", "value"),
new XElement("Attachment",new XElement("AttachmentName", attachment.Name),
new XElement("Subject", exchangeEmailInformation.Subject),
new XElement("Sender", exchangeEmailInformation.Sender
)));
doc.Save(ConfigInformation.BackUpPath + FolderId[index]+"\\Attachments"+index+".xml");