zoukankan      html  css  js  c++  java
  • 保存与设置 XML的方法

                string parms = @"<?xml version=""1.0"" encoding=""UTF-8""?>
                                <Params>
                                 <ExcelRule>{0}</ExcelRule>
                                 <ExcelFile>{1}</ExcelFile>
                                 <Handle>{2}</Handle>
                                 <SavePath>{3}</SavePath>
                                </Params>";

                parms = string.Format(parms, _excelRule, _excelFile, this.Handle, _excelSavePath);

                XmlDocument doc = new XmlDocument();
                doc.LoadXml(parms);
                doc.Save(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"ExcelToGSP\Params.xml"));


                //XmlDocument doc = new XmlDocument();
                //doc.Load(AppDomain.CurrentDomain.BaseDirectory + @"ExcelToGSP\Params.xml");
                //doc.SelectSingleNode("Params/ExcelRule").InnerText = ExcelRule;
                //doc.SelectSingleNode("Params/ExcelFile").InnerText = ExcelFile;
                //doc.SelectSingleNode("Params/Handle").InnerText = ExcelHandle;
                //doc.SelectSingleNode("Params/SavePath").InnerText = SavePath;

  • 相关阅读:
    什么是tomcat集群?
    cmd黑客入侵命令大全
    Linix基本命令
    Windows CMD命令大全
    python 函数1
    Python 集合(set)使用
    python 数据字典应用
    python 数据运算
    python 数据类型(元组(不可变列表),字符串
    python 数据类型(列表)学习笔记
  • 原文地址:https://www.cnblogs.com/chenqingwei/p/2020165.html
Copyright © 2011-2022 走看看