Exemple #1
0
        public ConfigFile(string fileInput)
        {
            Lists = new List <ConfigList>();
            file1 = new Jason();
            file2 = new DialogConfig();
            Excel.Application app;
            Excel.Workbook    workbook;
            Excel.Worksheet   worksheet;
            app      = new Excel.Application();
            workbook = app.Workbooks.Open(fileInput);

            for (int i = 1; i <= workbook.Sheets.Count; i++)
            {
                worksheet = workbook.Sheets[i];
                int listNum = CheckName(worksheet.Name);
                if (listNum != -1)
                {
                    Lists.Add(new ConfigList(worksheet, listNum));
                }
            }

            workbook.Close(false);
            app.Quit();

            ReadInfo();
        }
Exemple #2
0
        public static void TestParsing()
        {
            Jason ss = new Jason(5);
            DataContractJsonSerializer jsonFormatter = new DataContractJsonSerializer(typeof(ss));

            using (FileStream fs = new FileStream("test.json", FileMode.OpenOrCreate)) {
                jsonFormatter.WriteObject(fs, ss);
            }
        }