示例#1
0
        public bool Upload(HttpPostedFileBase file)
        {
            MemoryStream target = new MemoryStream();

            file.InputStream.CopyTo(target);
            byte[]   data     = target.ToArray();
            HttpFile httpFile = new HttpFile(file.FileName, file.ContentType, data);

            DataSet dataSet = ReadExcel.ToDataSet(httpFile.Buffer);

            DataTable resultDt = dataSet.Tables[0];

            List <Student> students = new List <Student>();

            students = Convertor.ConvertToList <Student>(resultDt);

            return(true);
        }