分页List

List.Skip((pagecount-1)*pagesize).Take(pagesize)

假设你每页10条数据
当前是第3页 跳到第4页
则:
List.Skip((4-1)*10).Take(10)
 
                int numb = 100;
                int size = (int)Math.Ceiling((decimal)List.Count / numb);
                for (int i = 1; i <= size; i++)
                {
                    var qList = List.Skip((i - 1) * numb).Take(numb).ToList();
                }

你可能感兴趣的:(C#)