zoukankan      html  css  js  c++  java
  • ASP HTMLEncode/HTMLDecode

    asp 有Server.HTMLEncode 却没有 Server.HTMLDecode.......

    需要自定义一个 HTMLDecode 函数:

    Function HTMLDecode(sText)
    	dim I
    	sText = Replace(sText, """, Chr(34))
    	sText = Replace(sText, "<", Chr(60))
    	sText = Replace(sText, ">", Chr(62))
    	sText = Replace(sText, "&" , Chr(38))
    	sText = Replace(sText, " ", Chr(32))
    	For I = 1 to 255
    	sText = Replace(sText, "&#" & I & ";", Chr(I))
    	Next
    	HTMLDecode = sText
    End  Function
    

      

    例子:

    <%
    
    Dim j
    Response.Write(Server.HTMLEncode("encode: 555  <p>hhhh</p>jj ffff  888 ") & "<br>-----------------------------<br>")
    Response.Write(HTMLDecode("decod: 555 <p>hhhh</p>jj ffff  888 "))
    Function HTMLDecode(sText)
    	dim I
    	sText = Replace(sText, """, Chr(34))
    	sText = Replace(sText, "<", Chr(60))
    	sText = Replace(sText, ">", Chr(62))
    	sText = Replace(sText, "&" , Chr(38))
    	sText = Replace(sText, " ", Chr(32))
    	For I = 1 to 255
    	sText = Replace(sText, "&#" & I & ";", Chr(I))
    	Next
    	HTMLDecode = sText
    End  Function
    %>
    

      

  • 相关阅读:
    压测mysql连接数
    OpenStack SR-IOV
    Scheduler 租户虚机到不同host
    Neutron 集成 DPDK
    Centos 7 密码重置
    win10优化
    Aria
    tomcat lb cluster
    Tomcat.md
    varnish.md
  • 原文地址:https://www.cnblogs.com/wgscd/p/10488490.html
Copyright © 2011-2022 走看看