zoukankan
html css js c++ java
多列分页算法
private
void
ShowRecord(
int
RecordCount,
int
CellCount,
int
CurrentPage)
{
int
CurrentRC,TotalCount,FinalCount,CurrentLocation;
string
ImageName,ImageUrl;
TableRow Tr
=
new
TableRow();
TableCell Tc
=
new
TableCell();
TotalCount
=
RecordInfo.GetRecordCount();
FinalCount
=
TotalCount
/
CellCount
+
1
;
TotalPage
=
(FinalCount
-
1
)
/
RecordCount
+
1
;
CurrentRC
=
FinalCount
-
(CurrentPage
-
1
)
*
RecordCount;
if
(CurrentRC
>
RecordCount) CurrentRC
=
RecordCount;
if
(CurrentPage
>
TotalPage) CurrentPage
=
1
;
for
(
int
i
=
(CurrentPage
-
1
)
*
RecordCount;i
<
CurrentRC
+
(CurrentPage
-
1
)
*
RecordCount;i
++
)
{
Tc.Controls.Add(
new
LiteralControl(
"
<table><tr>
"
));
for
(
int
j
=
1
;j
<=
CellCount;j
++
)
{
CurrentLocation
=
(CurrentPage
-
1
)
*
RecordCount
*
CellCount
+
(i
%
RecordCount)
*
CellCount
+
j;
if
(TotalCount
>=
CurrentLocation)
{
ImageName
=
RecordInfo.GetValue(CurrentLocation
-
1
,
1
);
ImageUrl
=
RecordInfo.GetValue(CurrentLocation
-
1
,
0
);
Tc.Controls.Add(
new
LiteralControl(
"
<td width='120' height='120'><a target='_blank' title='
"
+
ImageName
+
"
' href='
"
+
ImageUrl
+
"
'><img border='0' width='100' height='100' src='
"
+
ImageUrl
+
"
'></a></td>
"
));
}
else
j
=
CellCount
+
1
;
}
Tc.Controls.Add(
new
LiteralControl(
"
</tr></table>
"
));
Tr.Cells.Add(Tc);
pic.Rows.Add(Tr);
}
}
查看全文
相关阅读:
Android Native Hook技术(一)
Android Native Hook技术(二)
Dalvik源码阅读笔记(一)
Dalvik源码阅读笔记(二)
Android反调试笔记
/dev/mem可没那么简单
jenkins使用邮件功能
docker 安装 oracle
jstack
docker network
原文地址:https://www.cnblogs.com/Random/p/523450.html
最新文章
转:C#中TransactionScope的使用方法和原理
HTTP协议 学习:1-报文分析
HTTP协议 学习:0-有关概念
基于SQLite3的C/C++学习总结
Linux 网络编程的5种IO模型 总结
Windows 编译 FFMpeg
Linux驱动中的异步函数(aio_read和aio_write)
Linux 网络编程的5种IO模型:异步IO模型
Linux 网络编程的5种IO模型:信号驱动IO模型
基于 SQLite 3 的 C/C++ 学习:2-高级操作
热门文章
Windows/Linux 通过 ssh 打开 远程服务器 GUI程序
编写/etc/init.d脚本文件
疑难杂症
jenkins 与 gitlab 的持续集成
devops与CICD
devops概述
构建NDK交叉编译链
一种绕过PTRACE反调试的办法
Android SO UPX壳问题小记
XDCTF2015_re100
Copyright © 2011-2022 走看看