Пример #1
0
        /// <summary>
        /// 上传
        /// </summary>
        /// <returns></returns>
        public int Upload()
        {
            try
            {
                HttpPostedFileBase file     = Request.Files["Files"];
                string             PathName = Server.MapPath("/Uploads/");
                string             textPath = Path.Combine(PathName + file.FileName);
                file.SaveAs(textPath);
                DataTable dt = NPOIExcelHelper <Member> .Import(textPath);

                bl.Adds(dt);
                return(1);
            }
            catch
            {
                return(0);
            }
        }