首页/技术开发/内容

用文本+ASP打造新闻公布系统(二)新闻添加

技术开发2024-02-19 阅读()
")
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>




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

……

相关阅读