Inheritance: IDisposable
コード例 #1
0
ファイル: Program.cs プロジェクト: GHScan/DailyProjects
        public override void Execute()
        {
            Log.Info("Start to export excel to json...");

            using (var reader = new ExcelOperation.ExcelReader(ExcelPath, ExcelTitleRow, ExcelContentRow))
            {
                var sheets = new List<DataSheet>();
                foreach (var sheetName in ExcelSheetNames)
                {
                    Log.Info("Read sheet: {0}", sheetName);
                    sheets.Add(reader.Read(sheetName));
                }

                Log.Info("Write sheets to: {0}", JsonPath);
                File.WriteAllText(JsonPath, JsonOperation.SerializeSheets(sheets), Encoding.UTF8);
            }

            Log.Info("Done.");
        }
コード例 #2
0
        public override void Execute()
        {
            Log.Info("Start to export excel to json...");

            using (var reader = new ExcelOperation.ExcelReader(ExcelPath, ExcelTitleRow, ExcelContentRow))
            {
                var sheets = new List <DataSheet>();
                foreach (var sheetName in ExcelSheetNames)
                {
                    Log.Info("Read sheet: {0}", sheetName);
                    sheets.Add(reader.Read(sheetName));
                }

                Log.Info("Write sheets to: {0}", JsonPath);
                File.WriteAllText(JsonPath, JsonOperation.SerializeSheets(sheets), Encoding.UTF8);
            }

            Log.Info("Done.");
        }