关于我们 广告服务 社区论坛
设为首页 加入收藏

行业新闻
服 务 器
模版下载
建站指南
冲浪宝典
办公软件
网站运营
操作系统
QQ 专题
网页制作
安全防御
视频教程
网络编程
SEO专区
软件下载
图像设计
Cisco
网页特效
Wap 技术
联盟赚钱
网页素材
 首页 | 企业建站 | 网页制作 | 网站运营 | 网络编程 | 图像设计 | 冲浪宝典 | 操作系统 | SEO专区 | 联盟赚钱 | Cisco

欢迎来到e天下网络首页>>网络编程>>ASP>>正文|ASP:超长字符的智能分页

ASP:超长字符的智能分页

[ 来路:21kn.com    时间:2007-7-8 0:49:15    点击: ]

 

    Request Form Item
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")
if i_ishot = "" then i_ishot="N"
i_ispic  = request.form("ispic")
if i_ispic = "" then i_ispic ="N"
i_pic    = request.form("InsertImage")
i_body = replace(i_body,"contentEditable=true","contentEditable=false")

Check Input
......

Get Pages ,B = Body
B_Len = Len(I_Body)
B_Pages = 1
T = Temp
T_Loop = true

Do While T_Loop    这里loop多次,每4000分一页,算出页码并加入库。
If B_Len > 4000 then
    N_Body = Left(I_Body,4000)     N = New
    If "<P" in N_Body,Else ">" in N_Body
    If Instrrev(N_Body,"<P") > 0 and (Len(N_Body) - Instrrev(N_Body,"<P"))< 400 then
            N_Body = Left(N_Body,InstrRev(N_Body,"<P")-1)
        else if Instrrev(N_Body,"  ") > 0 and (Len(N_Body) - Instrrev(N_Body,"  "))< 400 then
                N_Body = Left(N_Body,InstrRev(N_Body,"  ")-1)
            Else If Instrrev(N_Body,"。") > 0 and (Len(N_Body) - Instrrev(N_Body,"。"))< 400 then
                    N_Body = Left(N_Body,InstrRev(N_Body,"。"))
                 Else If Instrrev(N_Body,";") > 0 and (Len(N_Body) - Instrrev(N_Body,";"))< 400 then
                            N_Body = Left(N_Body,InstrRev(N_Body,";"))
                        else if Instrrev(N_Body,",") > 0 and (Len(N_Body) - Instrrev(N_Body,","))< 400 then
                                N_Body = Left(N_Body,InstrRev(N_Body,","))
                            else if Instrrev(N_Body,".") > 0 and (Len(N_Body) - Instrrev(N_Body,"."))< 400 then
                                    N_Body = Left(N_Body,InstrRev(N_Body,"."))
                            end if
                        end if
                 End If
            End If
    end if
End if
   
    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
End If


Add to database
Exec_prc_Content_Ins I_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>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
<link rel="stylesheet" type="text/css" href="../CSS/default.css">
</head>

<body>

<div align="center">
  <center>

<table border=1 width="300" height="128" bordercolor="#000000" cellspacing="0" cellpadding="0" style="border-collapse: collapse"><tr>
  <td bgcolor="#DEDBD6" height="31">
录入成功</td></tr><tr><td height="96">
<p align="center">此文章共分<%=B_Pages-1%>页
</td></tr></table>


  </center>
</div>
<script>
top.main_top.location.reload();
</script>
 
</body>

::::站长友情提示:多花一分钟学点什么都好::::

 

上一篇:带进度条的ASP无组件断点续传下载  下一篇:一个非常简洁的ASP验证码程序实例

 ::热点信息::

 

= = 免责声明 = =

① 欢迎转载我网所刊信息,请注明“来源:E天下网络”。
② 凡本网注明“来源:XXX(非E天下网络)”的作品,均转载自其它媒体,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。如因作品内容、版权和其它问题需要同本网联系的,请在30日内进行。
※联系方式:Airtofly@163.com

::推荐文章::

 

ASP教程:详细学习ASP的内置对象

::图像设计::

 

动态图片搜索家——GIF RUNN
软件搜索利器——FileFerret
实例说明构图要讲规律
Character Builder让你尽展靓
全景图速成者Cool360
三维模型速成工具——Canoma
剪贴专家SmartBoard 32
新世纪的图像处理利器——Ph
更多内容..

 

 

关于我们 广告服务 友情链接 合作伙伴 社区论坛 免责声明

Copyright © 2007   21kn.com Inc. All rights reserved.e天下网络工作室

网站白天客服QQ:26875416 (非24小时)  合作QQ:597004688    粤ICP备06026423号