Public Function wipeScript(ByVal html As String) As String
        Dim regex1 As Regex = New Regex("<script[\s\S]+</script *>", RegexOptions.IgnoreCase)
        Dim regex2 As Regex = New Regex(" href *= *[\s\S]*script *:", RegexOptions.IgnoreCase)
        Dim regex3 As Regex = New Regex(" on[\s\S]*=", RegexOptions.IgnoreCase)
        Dim regex4 As Regex = New Regex("<iframe[\s\S]+</iframe *>", RegexOptions.IgnoreCase)
        Dim regex5 As Regex = New Regex("<frameset[\s\S]+</frameset *>", RegexOptions.IgnoreCase)
        html = regex1.Replace(html, "")
        html = regex2.Replace(html, "")
        html = regex3.Replace(html, " _disibledevent=")
        html = regex4.Replace(html, "")
        html = regex5.Replace(html, "")
        Return html
    End Function

解决方案 »

  1.   

    第三个是过滤onclick,onmouse......之类的
    后面两个是过滤框架的
      

  2.   

    急需csdn朋友大力支持 云 一点人气都没有我的问题现在怎么都没人会我一个三角 很多五角星的呢????
    出来求救
      

  3.   

    這個表達式的作用很有限了...
    最好加上編碼與解碼功能(防十六進制代碼)...
    最好還要過濾<object>,<applet>,<embed>等代碼..
      

  4.   

    过滤所有脚本的正则表达式:
    <script.*?>.*?</script>
    RegexOptions.SingleLine你给的那些除了过滤脚本,还有其他作用
      

  5.   

    gzgzggzgzggzgzgzggzggzgzgzgzggz
    upupupupupupupupupupupupupupupup