新建一文件articlechar.inc,其详细内容为:
<%
"Function法式是创立在子法式过程当中的成组处置功效上的,是一个自力的法式用来承受自变量以履行一系列的代码语句,和把处置好的代码语句的结直接前往给用户代码
function htmlencode2(str)
dim result
dim l
if isNULL(str) then
htmlencode2=""
exit function
end if
l=len(str)
result=""
dim i
for i = 1 to l
"对前往的内容停止剖断,并对其含有<,>,chr(13),chr(34),&,chr(32),chr(9)停止响应的转化,如chr(13)变成<br>;也就是回车的HTM代码
select case mid(str,i,1)
case "<"
result=result+"<"
case ">"
result=result+">"
case chr(13)
result=result+"<br>"
case chr(34)
result=result+"""
case "&"
result=result+"&"
case chr(32)
'result=result+" "
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 chr(9)
result=result+" "
case else
result=result+mid(str,i,1)
end select
next
htmlencode2=result
end function
%>