예제 #1
0
        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());
        }
예제 #2
0
        /// <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());
        }