public async Task Test_Import_1() { var workbook = await _excelImportService.ImportAsync <Barcode>(new ImportOptions() { FileUrl = "D:\\导入国标码_导入格式.xlsx", }); var result = workbook.GetResult <Barcode>(); Output.WriteLine(result.Count().ToString()); Output.WriteLine(result.ToJson()); }
/// <summary> /// 导入 /// </summary> /// <param name="path">文件路径</param> private async Task ImportAsync(string path) { var workbook = await _excelImportService.ImportAsync <ImportGoods>(new ImportOptions() { FileUrl = path }); var result = workbook.GetResult <ImportGoods>(); Output.WriteLine(result.Count().ToString()); Output.WriteLine(result.ToJson()); }