实习狗的每天新知识日常

准备工作:

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-11-29
  • 2021-10-18
  • 2020-10-06
  • 2021-11-19
  • 2021-11-18
  • 2021-11-29
  • 2019-06-11
  • 2018-11-07
猜你喜欢
  • 2021-08-09
  • 2022-01-07
  • 2019-01-25
  • 2021-11-14
  • 2021-12-10
  • 2021-11-02
  • 2021-01-22
  • 2018-11-06
相关资源
相似解决方案