

























使用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(); }
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。