asp html转换字符程序

2015-08-12 16:02:33来源:作者:人点击

这是一个简单的安全过滤函数了,把html 转换字符转换成可以显示的文本了

Function HTMLDecode(reString)
 Dim Str:Str=reString
 If Not IsNull(Str) Then
  Str = Replace(Str, "&", "&")
  Str = Replace(Str, ">", ">")
  Str = Replace(Str, "&lt;", "<")
  Str = Replace(Str, "&nbsp;", CHR(32))
     Str = Replace(Str, "&nbsp;", CHR(9))
  Str = Replace(Str, "&#160;&#160;&#160;&#160;", CHR(9))
  Str = Replace(Str, "&quot;", CHR(34))
  Str = Replace(Str, "&#39;", CHR(39))
  Str = Replace(Str, "", CHR(13))
  Str = Replace(Str, "<br>", CHR(10))
  HTMLDecode = Str
 End If
End Function

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台