private void 导入员工ToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog dialog = new OpenFileDialog(); DialogResult result = dialog.ShowDialog(); if (result == DialogResult.OK) { string path = dialog.FileName; var sfList = ImportDataFromExcel.GetStudentByExcel(path); if (sfList.Count > 0) { ImportDataFromExcel.Import(sfList); MessageBox.Show("导入成功!"); } } }