var book = new HSSFWorkbook();
var sheet = book.CreateSheet("学生信息表");
string[] headcell = { "学号", "姓名", "年龄", "性别" };
var row0 = sheet.CreateRow(0);
for (int i = 0; i < headcell.Length; i++)
{
var cell = row0.CreateCell(i);
cell.SetCellValue(new HSSFRichTextString(headcell[i]));
}
using (var ms = new MemoryStream())
{
book.Write(ms);