首先需要在项目中安装NPOI支持库,在NuGet中搜索NPOI直接安装即可。 安装图解一 安装图解二 //导入数据 public static DataTable Import(string filePath,string sheetName = "")