/// <summary>
/// Gets the page.
/// </summary>
/// <param name="pageIndex">Index of the page.第几页,从1开始算</param>
/// <param name="pageSize">Size of the page.每页的大小</param>
/// <param name="totalSize">The total size.记录总数</param>
/// <returns>返回从0开始的记录</returns>
static int[] GetPage(int pageIndex, int pageSize, int totalSize)
{
pageIndex--;
List<int> ps = new List<int>();
int p = 0;
while (p < totalSize)
{
p++;
if (p > pageSize * (pageIndex) && p <= pageSize * (pageIndex + 1))
ps.Add(p-1);//当符合此页时发生
}
return ps.ToArray();
}


作者:KKcat