实习狗的每天新知识日常

准备工作:

1.在项目中添加对NPOI的引用,NPOI下载地址:http://npoi.codeplex.com/releases/view/38113

2.NPOI学习系列教程推荐:http://www.cnblogs.com/tonyqus/archive/2009/04/12/1434209.html

NPOI下载,里面有五个dll,需要引用到你的项目,我这边用的mvc4+三层的方式架构的项目

我用的工具是(vs2012+sql2014)

 

准备工作做完,我们开始进入主题

1.前端页面,代码:

<div class="filebtn"> 
                @using (Html.BeginForm("importexcel", "foot", FormMethod.Post, new { enctype = "multipart/form-data" }))
                    {
                        <samp>请选择要上传的Excel文件:</samp>
                        <span  id="txt_Path"></span>
                        <strong>选择文件<input name="file" type="file" id="file" /></strong>@*
                        @Html.AntiForgeryToken()  //防止跨站请求伪造(CSRF:Cross-site request forgery)攻击
                     *@<input type="submit" id="ButtonUpload" value="提交"   class="offer"/> 
                    }
            </div>
excel

相关文章:

  • 2021-12-04
  • 2021-07-24
  • 2022-01-23
  • 2022-02-21
  • 2021-12-19
  • 2021-06-16
  • 2021-08-19
  • 2021-05-29
猜你喜欢
  • 2022-12-23
  • 2022-02-03
  • 2021-04-24
  • 2022-01-08
  • 2021-09-05
相关资源
相似解决方案