写excel

 FileStream file = new FileStream(@"test.xls",FileMode.Create);
 hssfworkbook.write(file);
 file.close();

读excel

FileStream file = new FileStream(@"test.xls",FileMode.Open,FileAccess.Read);

HSSFWorkbook hssfworkbook = new HSSFWorkbook(file);
HSSFSheet sheet1 = hssfworkbook.GetSheet("Sheet1");
file.Close();

 

posted on 2018-09-03 17:15  Xanthus博客  阅读(195)  评论(0编辑  收藏  举报