我已经编写了修改xml文件并向其中添加新节点的代码。但在文件末尾,我想添加空行。如何实现呢?
public void ModifyOutPutXMLFile(string filename, string MethodName)
{
string InterfaceName = filename;
filename = Path.Combine(outputFolder, filename + ".xml");
XmlDocument doc = new XmlDocument();
doc.Load(filename);
doc.Save(filename);
XmlElement foo = doc.CreateElement(MethodName);
XmlElement bar = doc.CreateElement("Output");
bar.InnerText = " ";
foo.AppendChild(bar);
doc.DocumentElement.AppendChild(foo);
doc.Save(filename);
}