⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 articlechar.inc

📁 一个ASP做的政府网站的全站程序
💻 INC
字号:

<%
 'Function程序是建立在子程序过程中的成组处理功能上的,是一个独立的程序用来接受自变量以执行一系列的代码语句,以及把处理好的代码语句的结直接返回给用户代码
Function HtmlEncode2(str)
    dim result
    dim strLen
    if isNULL(str) then 
       htmlencode2=""
       exit function
    end if
    strLen=len(str)
    result=""
dim i
for i = 1 to strLen
  '对返回的内容进行判定,并对其含有<,>,chr(13),chr(34),&,chr(32),chr(9)进行相应的转化,如chr(13)变为<br>;也就是回车的HTM代码
    select case mid(str,i,1)
           case "<"
                result=result+"&lt;"
           case ">"
                result=result+"&gt;"
           case chr(13)
                result=result+"<br>"
           case chr(34)
                result=result+"&quot;"
           case "&"
                result=result+"&amp;"
           case chr(32)            
           	'result=result+"&nbsp;"
                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+"&nbsp;"
                   else
                      result=result+" "
                   end if
                else
                   result=result+"&nbsp;"                     
                end if
           case chr(9)
                result=result+"    "
           case else
                result=result+mid(str,i,1)
         end select
       next
       htmlencode2=result
   End Function
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -