码迷,mamicode.com
首页 > 其他好文 > 详细

批量添加

时间:2017-11-22 15:12:33      阅读:105      评论:0      收藏:0      [点我收藏+]

标签:action   []   [1]   com   lis   bat   add   分享图片   批量   

技术分享图片

 

 

public ActionResult ImportData(string str)
        {
            string[] strList = str.Split(‘|‘);
            List<BatchInfo> list = new List<BatchInfo>();
            for (int i = 0; i < strList.Length; i++)
            {
                BatchInfo model = new BatchInfo();
                model.Name = strList[i].Split(‘,‘)[0].ToString();
                model.Age = Convert.ToInt32(strList[i].Split(‘,‘)[1].ToString());
                list.Add(model);
            }

            return View();
        }

批量添加

标签:action   []   [1]   com   lis   bat   add   分享图片   批量   

原文地址:http://www.cnblogs.com/NETSBW/p/7879055.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!