△大概在九九年做游戏网站的时候,就对文章的...... 大概在九九年做游戏网站的时候,就对文章的发布感到麻烦,不过那会儿玩ASP不精。只是将就用着。在遇到长文件 10000 字时网页就是一大片长了。 去年,做一个通用的文章与新闻管理系统时,曾写了一段代码,用来分离。现在贴出来。 要说明的是: 我的文章 录入界面是基于WEB的HEMLEDITOR,就像这里的ABC代码差不多。所以实际提交的是HTML格式的文本。 对HTML做了相应的处理,不会由HTML代码中切开。 这里另一位兄弟曾发表过一个,原理一样,不过我没仔细看过,不知有啥不同。 代码如下: -------------------------------------- '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 " " in N_Body 0 and (Len(N_Body) - Instrrev(N_Body," N_Body = Left(N_Body,InstrRev(N_Body," else if Instrrev(N_Body," ") > 0 and (Len(N_Body) - Instrrev(N_Body," "))< 400 then
|
|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )
GMT+8, 2024-10-1 01:22 , Processed in 0.124987 second(s), 12 queries , Gzip On, MemCache On.
Powered by Discuz! X3.5
© 2001-2023 Discuz! Team.