同上

解决方案 »

  1.   

    对webbrowser的内容进行正则匹配把<script></script>都去掉了
      

  2.   

    不用关掉IE的JS功能屏蔽弹出窗口的程序代码.
    '**************************************
    ' Name: Java Block(Update)
    ' Description:I have been getting report
    '     s that the Java Block on my last browser
    '     no longer blocks Java Pop Up windows so 
    '     I found an alternate way to block Pop Up
    '     windows without turning off Java Script.
    '     
    ' By: Serberus
    '
    ' Returns:If this works then it should b
    '     lock Pop Up windows.
    '
    ' Assumes:This code is just an API call 
    '     that closes the browser you are using wh
    '     en the page starts loading and when you 
    '     close the browser.
    This code only works With IE and NetScape.
    '
    ' Side Effects:This code has been tested
    '     only for WIN ME, IE5.5 You will get a "E
    '     rror: Cannot find window" but you are ab
    '     le to delete that from the code.
    '
    'This code is copyrighted and has' limited warranties.Please see http://w
    '     ww.Planet-Source-Code.com/xq/ASP/txtCode
    '     Id.23097/lngWId.1/qx/vb/scripts/ShowCode
    '     .htm'for details.'**************************************Private Sub Form_Unload(Cancel As Integer)
        On Error Resume Next
        Dim ieframe As Long
        Dim afxbabf As Long
        ieframe = FindWindow("ieframe", vbNullString)
        Call SendMessageLong(ieframe, WM_CLOSE, 0&, 0&)
        If ieframe = 0 Then
            MsgBox "Error: Cannot find window"
            Exit Sub
        End If
        Do
            DoEvents
                afxbabf = FindWindow("afx:400000:b:a06:6:3b5f", vbNullString)
                Call SendMessageLong(afxbabf, WM_CLOSE, 0&, 0&)
            Loop Until afxbabf <> 0
        End Sub
    Private Sub WebBrowser1_DownloadBegin()
        On Error Resume Next
        Dim ieframe As Long
        Dim afxbabf As Long
        ieframe = FindWindow("ieframe", vbNullString)
        Call SendMessageLong(ieframe, WM_CLOSE, 0&, 0&)
        If ieframe = 0 Then
            MsgBox "Error: Cannot find window"
            Exit Sub
        End If
        Do
            DoEvents
                afxbabf = FindWindow("afx:400000:b:a06:6:3b5f", vbNullString)
                Call SendMessageLong(afxbabf, WM_CLOSE, 0&, 0&)
            Loop Until afxbabf <> 0
        End Sub