标签:pre ng2 code exce using 使用 poi and excel
使用NPOI编辑Excel,如果不能保存,需要存到一个新的文件名:
XSSFWorkbook wb1 = null; using (var file = new FileStream("D:\\banding.xlsx", FileMode.Open, FileAccess.ReadWrite)) { wb1 = new XSSFWorkbook(file); } wb1.GetSheetAt(0).GetRow(0).GetCell(0).SetCellValue("Sample"); using (var file2 = new FileStream("D:\\banding2.xlsx", FileMode.Create, FileAccess.ReadWrite)) { wb1.Write(file2); file2.Close(); }
标签:pre ng2 code exce using 使用 poi and excel
原文地址:https://www.cnblogs.com/JasonBie/p/12298837.html