博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
NPOI 模板 下载
阅读量:4515 次
发布时间:2019-06-08

本文共 952 字,大约阅读时间需要 3 分钟。

FileStream file = new FileStream(Server.MapPath(@"TemFiles\2.xls"), FileMode.Open, FileAccess.Read);            HSSFWorkbook workbook = new HSSFWorkbook(file);            ISheet sheet1 = workbook.GetSheetAt(0);            IRow row1 = sheet1.CreateRow(0);            row1.CreateCell(0).SetCellValue(1);                      sheet1.CreateRow(0).CreateCell(0).SetCellValue("This is a Sample");            sheet1.GetRow(0).CreateCell(0).SetCellValue("This is a Sample");            MemoryStream msfile = new MemoryStream();             workbook.Write(msfile);            Response.ContentEncoding = System.Text.Encoding.UTF8;            Response.ContentType = "application/octet-stream";            var fileName = HttpUtility.UrlEncode("2");            Response.AppendHeader("Content-Disposition", "attachment; filename=" + fileName + ".xls");            Response.BinaryWrite(msfile.GetBuffer());

  

转载于:https://www.cnblogs.com/raoquandeyunfu/p/4364697.html

你可能感兴趣的文章
关于源代码及其管理工具的总结
查看>>
此文对你人生会有莫大好处的,建议永久保存 2013-07-26 11:04 476人阅读 评论(0) ...
查看>>
win10 压缩包安装mysql8.0.11报错:Access denied for user 'root'@'localhost'
查看>>
随笔:关于去年的WordPress建站的回忆
查看>>
iptables配置——NAT地址转换
查看>>
vue----生命周期
查看>>
tornado ThreadPoolExecutor
查看>>
类里的方法要不要加参数
查看>>
C#毫秒转时分秒格式
查看>>
flask SQLAlchemy pymysql 连接数据库
查看>>
Mac 域名解析
查看>>
ios ViewController present不同的方向
查看>>
未知宽高元素水平垂直居中
查看>>
while 、函数、参数
查看>>
POJ 2762 Going from u to v or from v to u?(Tarjan + 拓扑排序)
查看>>
洛谷P1312 [NOIP2011提高组Day1T3]Mayan游戏
查看>>
BZOJ4293: [PA2015]Siano
查看>>
java第五次实训作业异常处理
查看>>
linux常用命令总结(含选项参数)
查看>>
Why validation set ?
查看>>