标签:++ turn computer read gen while opp oid 来源
static int Main(string[] args)
{
//每页条数
const int pageSize = 2;
//页码 0就是第一条数据
int pageNum = 0;
string[] computer = { "苹果", "联想", "惠普", "Thinkpad", "三星", "VIVO", "OPPO", "华为", "小米", "微软", "神州", "IBM" };
while (pageNum * pageSize < computer.Length)
{
//分页skip,take方法
var page = computer.Skip(pageNum * pageSize).Take(pageSize);
Console.WriteLine("输出第{0}页记录", pageNum + 1);
//输出每页内容
foreach (var q in page)
{
Console.WriteLine(q);
}
pageNum++;
}
Console.ReadKey();
return 0; //如果是static void Main,则会报错
}
复制代码
list = list.Skip(pageNum* pageSize).Take(pageSize).ToL
list = list.Skip(2 * 2).Take(2).ToList();
复制代码
复制代码(编辑:雷林鹏 来源:网络)
标签:++ turn computer read gen while opp oid 来源
原文地址:https://www.cnblogs.com/pengpeng1208/p/9298313.html