private void import_btn_Click(object sender, EventArgs e) { try { if (filePaths.Length <= 0) { MessageBox.Show("请选择文件", "选择文件提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } fileName.Text = "数据导入中...."; bool result = false; foreach (var filePath in filePaths) { result = importLogic.ImportExcel(filePath) || result; } MessageBox.Show(result ? "导入成功" : "导入失败,请重试!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); fileName.Text = ""; filePaths = new string[0]; } catch (Exception exception) { MessageBox.Show("导入失败,请检查文档是否符合标准!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }