using Newtonsoft.Json; using System.Collections.Generic; using System.IO; namespace Server.Git { public class XlsxToJson : AbstractGit { public override void ChangeScript() { //저장경로 : repositoryPath //작업할것 //데이터 db에 업로드 List fileList = GetFiles(repositoryPath, ".xlsx"); Dictionary>> sheetList = new Dictionary>>(); for (int n = 0; n < fileList.Count; n++) { ExcelManager em = new ExcelManager(fileList[n]); if (em.Play()) { List sheets = em.sheets; for (int m = 0; m < sheets.Count; m++) { sheetList.Add(sheets[m].name, sheets[m].dicViewer); } } else { Console.WriteLine("-1 : NotUpdate"); return; } } excel = JsonConvert.SerializeObject(sheetList); //db에 데이터를올리는것은 이곳에 작성할 예정 } } }