0) mytext2=myread2.readall dim listarray,i,h,count,sf listarray=split(mytext2,"|") '#########读取记录并以#分割成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)&"|") end if next %〉 〈script language="javascript"〉 alert("更改成功"); window.location=("news_admin1.asp"); 〈/script〉上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] 2007-9-18 22:47:50免费资源duzhi.net |