sub ShowBody(str)
dim result
dim k
k=len(str)
result=""
dim i
for i=1 to k
select case mid(str,i,1)
case "<"
result=result+"<"
case ">"
result=result+">"
case chr(34)
result=result+"""
case "&"
result=result+"&"
case chr(13)
result=result+"<br>"
case chr(255) '防止特殊空格
result=result
' case chr(10) '防止换行符
'result=result+"<br>"
case chr(9)
result=result+" "
case chr(32)
result=result+" "
if i+1<=k 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
response.write result
end sub
sub adjust_msg(adj_str)
dim i,final_str=""
adj_str=trim(adj_str)
if len(adj_str)>0 then
for i=1 to len(adj_str)
select case Mid(adj_str,i,1)
case chr(13)
final_str=final_str&""
case chr(10)
final_str=final_str&" "
case else
final_str=final_str& Mid(adj_str,i,1)
end select
next
end if
adj_msg=final_str
end sub
你自己去看一看吧!作为参考。