传奇服务器如何做网站,深圳市市场监督管理局官网,全网营销案例,城固县网站建设阅读: 1 评论: 0 作者: eng308 发表于 2010-02-03 10:33 原文链接利用统计文章字数#xff0c;然后达到一定字数就截断输出#xff0c;但是分页的内容就会在莫名其妙的地方截断#xff0c;不是很友好。很简单#xff0c;在要截断的地方附近找下面的符号:#xff1b;’”然后达到一定字数就截断输出但是分页的内容就会在莫名其妙的地方截断不是很友好。很简单在要截断的地方附近找下面的符号:’”。;.!如果后面存在p或br就分页。主要是要研究文章的格式。%if Request.ServerVariables(Content_Length) 0 thencontent Request.Form(textarea1) PageLength 1000 每页字数CLength Len(content)PageCount Int(Clength/PageLength) 1 计算页数 dim PageArrayredim PageArray(PageCount) Seperator Array(chr(13),chr(10),。,,,,,”,’) 分隔符 PageArray(0) 0Pos 0for j0 to ubound(Seperator)Pos instr(PageArray(i)900,content,Seperator(j)) PageArray(i)900 附近位置是100字1-999可调while Pos 0 and Pos (i1)*PageLength and Pos i*PageLengthPageArray(i) PosPos instr(PosPageLength,content,Seperator(j))wend if PageArray(i) 0 then Response.Write 0:i| PageArray(i)brj:jSeperator(j)brj j ubound(Seperator) 1 end ifnext for i1 to PageCount-1PageArray(i) 0Pos 0for j0 to ubound(Seperator)Pos instr(PageArray(i-1)950,content,Seperator(j)) while Pos 0 and Pos (i1)*PageLength and Pos i*PageLengthPageArray(i) PosPos instr(PosPageLength,content,Seperator(j))wend if PageArray(i) 0 then Response.Write i:i| PageArray(i)brj:jSeperator(j)brj j ubound(Seperator) 1 end ifnextnext output mid(content,1,PageArray(0))output replace(output,chr(13),br)Response.Write brbr第1段brResponse.Write output for i1 to PageCount-2output mid(content,PageArray(i-1)1,PageArray(i)-PageArray(i-1))output replace(output,chr(13),br)Response.Write brbr第i1段brResponse.Write outputnext 最后一段的输出就没写了 else%FORM action methodPOST idform1 nameform1TEXTAREA rows70 cols120 idtextarea1 nametextarea1/TEXTAREAINPUT typesubmit valueSubmit idsubmit1 namesubmit1/FORM%end if%评论: 0 查看评论 发表评论最新新闻· 传盛大密签王菲 春晚实为游戏电影造势(2010-02-06 12:28)· 商业周刊乔布斯iPad志在云计算(2010-02-06 12:27)· 十大最佳Ajax教程(2010-02-06 12:21)· 微软下周不修复新IE漏洞(2010-02-06 12:18)· Firefox 4.0演示视频曝光(2010-02-06 12:10)编辑推荐ASP.NET MVC 2 RC 2 发布网站导航博客园首页 个人主页 新闻 闪存 小组 博问 社区 知识库转载于:https://www.cnblogs.com/tanshuicai/archive/2010/02/03/1664902.html