另一个分页函数
/// <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();}
總結
- 上一篇: Windows2003使用命令行设置共享
- 下一篇: “手机”是个什么机器?