答案 0 :(得分:0)
也许你需要这样的东西。使用名为" Credentials"
的根节点private void CreateXml()
{
var document = new XmlDocument();
XmlNode rootNode = document.CreateElement("Credentials");
document.AppendChild(rootNode);
rootNode.AppendChild(document.CreateElement("EncryptionKey"));
rootNode.AppendChild(document.CreateElement("SaltKey"));
rootNode.AppendChild(document.CreateElement("VIKey"));
rootNode.AppendChild(document.CreateElement("EmailUsername"));
rootNode.AppendChild(document.CreateElement("EmailPassword"));
XmlNode declaration = document.CreateXmlDeclaration("1.0", "UTF-8", null);
document.InsertBefore(declaration, rootNode);
document.Save("Credentials.xml");
}
编辑:添加了声明