首页/技术开发/内容

用文本+ASP打造新闻公布系统(5)新闻更改

技术开发2024-02-19 阅读()
") '#########读取记录并以#分割成listarray数组
count=ubound(listarray)

for i=0 to count '###########根据ID找到该新闻记录
sf=split(listarray(i),",")
if right(sf(0),7)=right(id,7) then
sf(1)=mytitle
sf(3)=src

'#######为6说明上传了图片,存储新的数组实现查看记录点击次数加1
if ubound(sf)=6 then
If Fields(newfile).FileName<>"" Then
sf(6)=imageid
end if
listarray(i)=sf(0)&","&sf(1)&","&sf(2)&","&sf(3)&","&sf(4)&","&sf(5)&","&sf(6)
else
listarray(i)=sf(0)&","&sf(1)&","&sf(2)&","&sf(3)&","&sf(4)&","&sf(5)
end if
'##################
exit for
end if

next


function htmlencode2(str) '#############字符处理函数
dim result
dim l
l=len(str)
result=""
dim i
for i = 1 to l
select case mid(str,i,1)

case chr(34)
result=result+"''"
case "&"
result=result+"&"
case chr(13)
result=result+"<br>"
case " "
result=result+" "
case chr(9)
result=result+" "
case chr(32)
if i+1<=l and i-1>0 then
if mid(str,i+1,1)=chr(32) or mid(str,i+1,1)=chr(9) or mid(str,i-1,1)=chr(32) or mid(str,i-1,1)=chr(9) then
result=result+" "
else
result=result+" "
end if
else
result=result+" "
end if
case else
result=result+mid(str,i,1)
end select
next
htmlencode2=result
end function
'##########################
dim k,mytext,mappath
mappath=server.mappath("./")
set mytext=myfso.createtextfile(mappath&"\new_list.asp",-1,0)

for i=0 to ubound(listarray)' ##########把所有数据重新写入文件
if i=ubound(listarray) then
mytext.write htmlencode2(listarray(i))
else
mytext.write htmlencode2(listarray(i)&"(北联网教程,专业提供视频软件下载)

第1页  第2页  第3页  第4页  第5页  第6页  第7页  第8页 

……

相关阅读