新建一文件articlechar.inc,其具體內(nèi)容為: <% "Function程序是建立在子程序過程中的成組處理功能上的,是一個獨立的程序用來接受自變量以執(zhí)行一系列的代碼語句,以及把處理好的代碼語句的結(jié)直接返回給用戶代碼 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 "對返回的內(nèi)容進行判定,并對其含有<,>,chr(13),chr(34),&,chr(32),chr(9)進行相應的轉(zhuǎn)化,如chr(13)變?yōu)?lt;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 %>