您当前的位置: 首页 > 网站编程 > ASP教程 > ASP中超长字符的智能分页方法

ASP中超长字符的智能分页方法

作者:guanchaofeng 来源:不详 发布时间: 2009-05-08 16:07 点击:
RequestFormItem I_Forder=Request.Form(I_Folder) I_Topic=Request.Form(I_Topic) I_Title=htmlencode(Request.Form(I_Title)) I_Body=Request.Form(body) I_Source=Request.Form(I_Source) I_Keyword=htmlencode(Request.Form(I_Keyword)) I_ISHOT=request

ASP中超长字符的智能分页方法

  RequestFormItem
  I_Forder=Request.Form("I_Folder")
  I_Topic=Request.Form("I_Topic")
  I_Title=htmlencode(Request.Form("I_Title"))
  I_Body=Request.Form("body")
  I_Source=Request.Form("I_Source")
  I_Keyword=htmlencode(Request.Form("I_Keyword"))
  I_ISHOT=request.form("ishot")
  ifi_ishot=""theni_ishot="N"
  i_ispic=request.form("ispic")
  ifi_ispic=""theni_ispic="N"
  i_pic=request.form("InsertImage")
  i_body=replace(i_body,"contentEditable=true","contentEditable=false")
  
  CheckInput
  ......
  
  GetPages,B=Body
  B_Len=Len(I_Body)
  B_Pages=1
  T=Temp
  T_Loop=true
  
  DoWhileT_Loop这里loop多次,每4000分一页,算出页码并加入库。
  IfB_Len>4000then
  N_Body=Left(I_Body,4000)N=New
  If"<P"inN_Body,Else">"inN_Body
  IfInstrrev(N_Body,"<P")>0and(Len(N_Body)-Instrrev(N_Body,"<P"))<400then
  N_Body=Left(N_Body,InstrRev(N_Body,"<P")-1)
  elseifInstrrev(N_Body,"")>0and(Len(N_Body)-Instrrev(N_Body,""))<400then
  N_Body=Left(N_Body,InstrRev(N_Body,"")-1)
  ElseIfInstrrev(N_Body,"。")>0and(Len(N_Body)-Instrrev(N_Body,"。"))<400then
  N_Body=Left(N_Body,InstrRev(N_Body,"。"))
  ElseIfInstrrev(N_Body,";")>0and(Len(N_Body)-Instrrev(N_Body,";"))<400then
  N_Body=Left(N_Body,InstrRev(N_Body,";"))
  elseifInstrrev(N_Body,",")>0and(Len(N_Body)-Instrrev(N_Body,","))<400then
  N_Body=Left(N_Body,InstrRev(N_Body,","))
  elseifInstrrev(N_Body,".")>0and(Len(N_Body)-Instrrev(N_Body,"."))<400then
  N_Body=Left(N_Body,InstrRev(N_Body,"."))
  endif
  endif
  EndIf
  EndIf
  endif
  Endif
  
  N_Len=Len(N_Body)
  I_Body=Mid(I_Body,N_Len+1)
  B_Len=Len(I_Body)
  
  Else
  N_Body=I_Body
  T_Loop=false
  EndIf
  
  
  Addtodatabase
  Exec_prc_Content_InsI_Forder,I_Topic,I_Title,I_Source,N_Body,i_ispic,i_pic,i_ishot,I_Keyword,B_Pages
  
  这里一个function,你可以自己处理,反正结果有两个,一个是body,一个是b_pages,就是页码。
  
  
  B_Pages=B_Pages+1
  
  Loop
  
  
  %>
  
  <html>
  
  <head>
  <metaname="GENERATOR"content="MicrosoftFrontPage5.0">
  <metaname="ProgId"content="FrontPage.Editor.Document">
  <metahttp-equiv="Content-Type"content="text/html;charset=gb2312">
  <title>新建网页1</title>
  <linkrel="stylesheet"type="text/css"href="../CSS/default.css">
  </head>
  
  <body>
  
  <divalign="center">
  <center>
  
  <tableborder=1width="300"height="128"bordercolor="#000000"cellspacing="0"cellpadding="0"style="border-collapse:collapse"><tr>
  <tdbgcolor="#DEDBD6"height="31">
  录入成功</td></tr><tr><tdheight="96">
  <palign="center">此文章共分<%=B_Pages-1%>页
  </td></tr></table>
  
  
  </center>
  </div>
  <script>
  top.main_top.location.reload();
  </script>
  
  </body>

分享到:
本文"ASP中超长字符的智能分页方法"由远航站长收集整理而来,仅供大家学习与参考使用。更多网站制作教程尽在远航站长站。
顶一下
(0)
0%
踩一下
(0)
0%
[点击 次] [返回上一页] [打印]
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 密码: 验证码:
关于本站 - 联系我们 - 网站声明 - 友情连接- 网站地图 - 站点地图 - 返回顶部
Copyright © 2007-2013 www.yhzhan.com(远航站长). All Rights Reserved .
远航站长:为中小站长提供最佳的学习与交流平台,提供网页制作与网站编程等各类网站制作教程.
官方QQ:445490277 网站群:26680406 网站备案号:豫ICP备07500620号-4