简单的C# 保存内容到指定路径下的XML文件中方法

来源:互联网 发布:淘宝网运费设置模板 编辑:程序博客网 时间:2024/05/14 09:32
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文件
        }
原创粉丝点击