思路: 导入: 1,初始化一个OpenFileDialog类 (OpenFileDialog fileDialog = new OpenFileDialog();) 2, 获取用户选择文件的后缀名(string extension = Path.GetExtension(fileDialog.FileName).ToLower();),并设置允许后缀文件名: 3,NPOI转datetable,遍历tatetable转成实体类列表并入库: 导出: 1, 创建提示用户保存类,SaveFileDial