CopyCode The Code is as follows: Public String outputbyline (string strcontent) // pagination by setting the number of rows
{
Int pagesize = int. parse (configurationmanager. etettings ["pagesize"]); // retrieve the number of lines displayed on each page from the config file
String linebreak = configurationmanager. receivettings ["linebreak"]; // The linefeed is extracted from the config file.
String linebreaks = "<" + linebreak + "> ";
String linebreake = "</" + linebreak + "> ";
Strcontent = strcontent. Replace ("\ r \ n ","");
String [] strlined = strcontent. Split (New String [] {linebreaks, linebreake}, stringsplitoptions. removeemptyentries); // use Div as the line break
Int pagecount = strlined. Length/pagesize;
Int pagecountplus = strlined. Length % pagesize = 0? 0: 1; // non-full page
Pagecount = pagecount + pagecountplus; // total number of pages
Int currentpage = 1; // current page number
String displaytext = NULL;
If (request. querystring ["pageindex"]! = NULL) // obtain the page number
{
Currentpage = convert. toint32 (request. querystring ["pageindex"]. tostring ());
}
String pageinfo = ""; // page number
For (INT I = 1; I <pagecount + 1; I ++)
{
if (I = currentpage)
{< br> pageinfo + = "page" + I + ";
If (pagecount> 1)
{< br> pageinfo + = "|";
}< BR >}< br> else
{< br> pageinfo + = string. format (" {0} | ", I );
}< BR >}< br> labpagenumber. TEXT = pageinfo;
for (INT I = (currentPage-1) * pagesize; I {< br> displaytext + = "
" + strlined [I] + "
";
}< br> return displaytext;
}