private void TestEncodingBtn_Click(object sender, EventArgs e) { string enCodeCode = enCodingList.GetItemText(enCodingList.SelectedItem); if ((enCodeCode == "") || (fileFolderText.Text == "")) { MessageBox.Show("请选择课程所在目录或编码", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } string jsonFile = JsonFileProcessor.ReadJsonFile(fileFolderText.Text, enCodeCode); richTextBox.Text = jsonFile; }
private void TestEncodingBtn_Click(object sender, EventArgs e) { richTextBox.Text = ""; string enCodeCode = enCodingList.GetItemText(enCodingList.SelectedItem); //if((enCodeCode == "")||(fileFolderText.Text == "")){ if (fileFolderText.Text == "") { MessageBox.Show("请选择课程所在目录", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } JsonFileProcessor jsonFileProcessor = new JsonFileProcessor(fileFolderText.Text, enCodeCode); string jsonFile = jsonFileProcessor.ReadJsonFile(fileFolderText.Text)[0]; if (jsonFile == "") { MessageBox.Show("当前目录下没有找到Json文件", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } richTextBox.Text = jsonFile; }