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
%>

  

ASP HTMLEncode/HTMLDecode的更多相关文章

  1. javascript 实现htmlEncode htmlDecode

    屌屌的写法..function htmlEncode(value){ //create a in-memory div, set it's inner text(which jQuery automa ...

  2. js转义和反转义html htmlencode htmldecode

    文章目录 JS实现HTML标签转义及反转义 用Javascript进行HTML转义 1.HTML转义 2.反转义 3.一个有意思的认识 4.完整版本的代码 其他 [转义字符]HTML 字符实体< ...

  3. 几种HtmlEncode的区别(转)

    一.C#中的编码 HttpUtility.HtmlDecode.HttpUtility.HtmlEncode与Server.HtmlDecode.Server.HtmlEncode与HttpServe ...

  4. (转)几种HtmlEncode的区别

    一.C#中的编码 HttpUtility.HtmlDecode.HttpUtility.HtmlEncode与Server.HtmlDecode.Server.HtmlEncode与HttpServe ...

  5. 06 ASP.net

    ASP.net 第一天 理解浏览器与服务器概念,与WinForm的区别. C# IIS(Internet Information Service) 互联网信息服务 Java(Tomcat) Php(A ...

  6. 第十五节:HttpContext五大核心对象的使用(Request、Response、Application、Server、Session)

    一. 基本认识 1. 简介:HttpContext用于保持单个用户.单个请求的数据,并且数据只在该请求期间保持: 也可以用于保持需要在不同的HttpModules和HttpHandlers之间传递的值 ...

  7. HttpContext对象下的属性Application、Cache、Request、Response、Server、Session、User

    概述: HttpContext封装关于单个HTTP请求的所有HTTP特定信息. HttpContext基于HttpApplication的处理管道,由于HttpContext对象贯穿整个处理过程,所以 ...

  8. asp.net Server.HtmlEncode和HtmlDecode

    <html xmlns="http://www.w3.org/1999/xhtml"><head runat="server">< ...

  9. 【C#】C#中的HtmlEncode与HtmlDecode:HttpUtility.HtmlEncode,HttpUtility.HtmlDecode,Server.HtmlEncode,Server.HtmlDecode,WebUtility.HtmlEncode,WebUtility.HtmlDecode

    HtmlEncode(String) 将字符串转换为 HTML 编码字符串. HtmlDecode(String) 将已经为 HTTP 传输进行过 HTML 编码的字符串转换为已解码的字符串. 在we ...

随机推荐

  1. 搜狐eHR团队-曾经一起奋斗过的~

    昨天所有搜狐eHR团队同事再相聚(在职+离职),大家聊的都很开心,共同回顾了eHR项目从无到有的过程. 非常感谢在搜狐的工作经历,自己成长很多,目前大家分布在各个公司为eHR做着贡献,大家都注意身体~ ...

  2. Linux 磁盘使用查看 查看使用磁盘程序 Monitoring disk activity in linux

    5 TOOLS FOR MONITORING DISK ACTIVITY IN LINUX Here is a quick overview of 5 command-line tools that ...

  3. Fiddler抓包使用教程-模拟低速网络环境

    转载请标明出处:http://blog.csdn.net/zhaoyanjun6/article/details/73467267 本文出自[赵彦军的博客] 在无线测试中,网络测试是必不可少的环节,通 ...

  4. (网页)理解Angular中的$apply()以及$digest()

    转自CSDN: 工作有问题上CSDN上转转. $apply()和$digest()在AngularJS中是两个核心概念,但是有时候它们又让人困惑.而为了了解AngularJS的工作方式,首先需要了解$ ...

  5. Python使用np.c_和np.r_实现数组转换成矩阵

    # -*- coding: utf-8 -*-"""Created on Sat Jun 30 14:49:22 2018 @author: zhen"&quo ...

  6. [20180606]如何dump数据库里面的汉字.txt

    [20180606]如何dump数据库里面的汉字.txt --//链接http://www.itpub.net/thread-2102613-1-2.html的问题. 比如:col 41: [42]e ...

  7. Java —— 对象

    创建对象 int[] b = new int[30]; 等号右侧:创建了一个数组对象  // 等号左侧:变量 b 称为该对应的引用  // 称作 变量 b 指向了一个对象  // 有时也简称为: b ...

  8. npm与yarn常用命令对比

    最近在用yarn,但是命令老是记不住,在此记录,方便日后翻看 图片截取自:http://yuanhehe.cn/2017/06/11/npm-%E4%B8%8E-Yarn-%E5%B8%B8%E7%9 ...

  9. 用Python做股市数据分析(一)

    本文由 伯乐在线 - 小米云豆粥 翻译.未经许可,禁止转载!英文出处:Curtis Miller.欢迎加入翻译组. 这篇博文是用Python分析股市数据系列两部中的第一部,内容基于我犹他大学 数学39 ...

  10. 26_ArrayList_HashSet的比较及Hashcode分析

    实体类: package com.itcast.day1; public class ReflectPoint { private int x; public int y; public Reflec ...