Beispiel #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            string   str          = System.AppDomain.CurrentDomain.BaseDirectory;
            FileInfo file         = new FileInfo("McuConfiglist.xlsx");
            string   FileFullPath = file.FullName.ToString();

            dt = excle.GetExcelToDataTableBySheet(FileFullPath, "Sheet1");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                comboBox1.Items.Add(dt.Rows[i][0]);
            }
            //string y = System.Text.Encoding.Default.GetString(Convert.FromBase64String(x));


            string  jsonText      = "{\"zone\":\"海淀\",\"zone_en\":\"haidian\"}";
            JObject jo            = (JObject)JsonConvert.DeserializeObject(jsonText);
            string  zone          = jo["zone"].ToString();
            string  FileBase64str = js.FileToBase64(FileFullPath);


            jm.OpenFile(".\\mcu\\mcusFeaturesAndDescription.json");
            jm.Save(".\\mcu\\mcusFeaturesAndDescription1.json");
            DataTable dt1 = jm.toDataTable(jm.Serialize(jm.jo));

            dataGridView1.DataSource = dt1;
        }
Beispiel #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            string   str          = System.AppDomain.CurrentDomain.BaseDirectory;
            FileInfo file         = new FileInfo("McuConfiglist.xlsx");
            string   FileFullPath = file.FullName.ToString();

            dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;


            jo = JsonManager.OpenFile(".\\mcu\\mcusFeaturesAndDescription.json");
            string jstr = JsonManager.Serialize(jo);

            JsonManager.Save(jo, ".\\mcu\\mcusFeaturesAndDescription1.json");

            dt = JsonManager.toDataTable(jstr);
            dataGridView1.DataSource = dt;
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                comboBox1.Items.Add(dt.Rows[i][0]);
            }
        }