public void SaveXML(string content,string fullFilePath,string xmlFileName)
{
XmlDocument doc = new XmlDocument();
doc.LoadXml(content);
if (System.IO.Directory.Exists(fullFilePath) == false)
{
System.IO.Directory.CreateDirectory(fullFilePath);
}
doc.Save(fullFilePath + xmlFileName);//保存XML文件
}
{
XmlDocument doc = new XmlDocument();
doc.LoadXml(content);
if (System.IO.Directory.Exists(fullFilePath) == false)
{
System.IO.Directory.CreateDirectory(fullFilePath);
}
doc.Save(fullFilePath + xmlFileName);//保存XML文件
}
本文介绍了一个使用C#实现的保存XML文件的方法。该方法通过传递XML字符串内容、完整路径及文件名来创建或更新XML文件。如果指定路径不存在,会自动创建路径。
4988

被折叠的 条评论
为什么被折叠?



