r>set outstream=file_O.OpenTextFile(file_name,8,false,-1) outstream.write midb(Fields(newfile).Value,binlen) outstream.close if notes=bnote then notes=notes&(binlen-1)&"字节处。"
End If
'###################################################################################### 把新闻数据结构写入newslist文件 dim mappath,mytext,myfso,contenttext,news_addtime,news_point news_point=1 news_addtime=mytime set myfso=createobject("scripting.filesystemobject") mappath=server.mappath("./")
set mytext=myfso.opentextfile(mappath&"\new_list.asp",8,-1)
dim mytext2 if len(varchar)〈〉0 then mytext2=trim(id&","&news_title&","&id&".txt"&","&news_src&","&news_point&","&news_addtime&","&imageid&"|") else mytext2=trim(id&","&news_title&","&id&".txt"&","&news_src&","&news_point&","&news_addtime&"|") end if mytext.writeline(mytext2) mytext.close
'##############把新闻内容写入相应的文件中 set contenttext=myfso.OpenTextFile(mappath&"\news_content\"&id&".txt",8,-1) 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 '############################################################################
contenttext.write htmlencode2(news_content) contenttext.close set myfso=nothing %〉 〈script〉 alert("发布成功"); window.location="news_add.asp"; 〈/script〉//新闻列表显示
〈% dim myfso,myread set myfso=createobject("scripting.filesystemobject")上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] 下一页 2007-9-18 22:47:50免费资源duzhi.net |
|