")Str=Replace(Str,"" />
 手机
当前位置:查字典教程网 >编程开发 >ASP教程 >asp下实现对HTML代码进行转换的函数
asp下实现对HTML代码进行转换的函数
摘要:",">")Str=Replace(Str,"

<%

'******************************

'函数:HTMLEncode(reString)

'参数:reString,待编码转换处理的字符串

'作者:阿里西西

'日期:2007/7/15

'描述:对HTML代码进行转换

'示例:HTMLEncode("<p>欢迎访问<br>阿里西西</p>")

'******************************

FunctionHTMLEncode(reString)

DimStr:Str=reString

IfNotIsNull(Str)Then

Str=UnCheckStr(Str)

Str=Replace(Str,"&","&")

Str=Replace(Str,">",">")

Str=Replace(Str,"<","<")

Str=Replace(Str,CHR(32),"")

Str=Replace(Str,CHR(9),"")

Str=Replace(Str,CHR(9)," ")

Str=Replace(Str,CHR(34),""")

Str=Replace(Str,CHR(39),"")

Str=Replace(Str,CHR(13),"")

Str=Replace(Str,CHR(10),"<br>")

HTMLEncode=Str

EndIf

EndFunction

'反转换HTML代码

FunctionHTMLDecode(reString)

DimStr:Str=reString

IfNotIsNull(Str)Then

Str=Replace(Str,"&","&")

Str=Replace(Str,">",">")

Str=Replace(Str,"<","<")

Str=Replace(Str,"",CHR(32))

Str=Replace(Str,"",CHR(9))

Str=Replace(Str," ",CHR(9))

Str=Replace(Str,""",CHR(34))

Str=Replace(Str,"",CHR(39))

Str=Replace(Str,"",CHR(13))

Str=Replace(Str,"<br>",CHR(10))

HTMLDecode=Str

EndIf

EndFunction

%>

【asp下实现对HTML代码进行转换的函数】相关文章:

利用ASP实现事务处理的方法

asp下多个域名后缀同时查询的域名查询系统

asp 中常用的文件处理函数

asp 常用函数用法

写入文本文件的过程函数(ASP)

用asp实现无组件生成验证码的方法2种

asp实现sql的备份与恢复

asp中的Rnd 函数

asp获取当前URL代码

对ASP脚本源代码进行加密

精品推荐
分类导航