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;

相关文章:

  • 2021-11-25
  • 2022-12-23
  • 2021-06-09
  • 2021-12-10
  • 2021-09-19
  • 2022-12-23
  • 2021-07-13
  • 2022-12-23
猜你喜欢
  • 2021-09-07
  • 2022-01-11
  • 2021-12-07
  • 2021-12-08
  • 2022-12-23
相关资源
相似解决方案