推荐下天枫常用ASP函数封装,推荐大家使用

2019-04-02 04:46:55于丽

            Str=Replace(Str,Chr(9),"")
            Str=replace(Str,"|","|")
            Str=replace(Str,chr(39),"'")
            Str=replace(Str,"<","<")
            Str=replace(Str,">",">")
            Str = Replace(str, CHR(13),"")
            Str = Replace(str, CHR(10),"")
            FiltrateHtmlCode=Str
        End If
    End Function

    '****************************************************
    '函数名:HtmlCode
    '作  用:过滤Html标签
    '参  数:str ----字符串
    '****************************************************
    Public function HtmlCode(str)
        If Not isnull(str) And str<>"" then
            str = replace(str, ">", ">")
            str = replace(str, "<", "<")
            str = Replace(str, CHR(32), " ")
            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), "")
            str = Replace(str, "script", "script")
            HtmlCode = str
        End If
    End Function

    '****************************************************
    '函数名:Replacehtml
    '作  用:清理html