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;

  • 相关阅读:
    星空雅梦
    星空雅梦
    Navicat permium快捷键
    Mysql建表+创建索引
    mysql 常见ALTER TABLE操作
    mysql常用的索引种类
    xShell终端中文乱码-解决方法
    git删除本地分支和远程分支
    git版本回退
    log4j2配置文件log4j2.xml详解
  • 原文地址:https://www.cnblogs.com/chenqingwei/p/2020165.html
Copyright © 2011-2022 走看看