Question : Convert C#? to VB / vb.script

Could somone please convert the script on the below question's solution  to VB /vb.script.   i need to do the same thing but in vb. Please help! thanks

http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_21718367.html?sfQueryTermInfo=1+alert+javascript+stop


Answer : Convert C#? to VB / vb.script

Ok, here's something for you to try on for size: (all it takes is a little research and you could have come up with the answer!)


1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
Dim IE
Dim scripts
Dim script_text

'Set IE = CreateObject("InternetExplorer.Application")
Set IE = WScript.CreateObject ("InternetExplorer.Application", "IE_")
With IE
        .left=200
        .top=200
        .height=480
        .width=600
        .menubar=1
        .toolbar=1
        .statusBar=1
        '
        ' The code on this page WILL throw an error.
        '
        .navigate "http://www.delphicommunity.com/teststop.html"        
        .visible=1
End With

' Don't need the loop because we are using the events
While 1: WSH.Sleep 1000 : Wend

Set IE = Nothing
WScript.Quit(0)

Sub IE_DocumentComplete(ByVal pDisp, URL)
  MsgBox "DocumentComplete event raised for URL: " & URL
  With IE.Document
          Set scripts = ie.document.all.tags("script")
          For x = 0 to scripts.length-1
             script_text = scripts(x).text
             If InStr(script_text, "alert") > 0 Then
               scripts(x).text = "function stopError() {return true;}window.onerror = stopError;"       
             End If
             script_text = scripts(x).text
             MsgBox(script_text)
          Next
  End With
End Sub

Sub IE_OnQuit()
  MsgBox "IE quits"
  WSH.Quit
End Sub
Random Solutions  
 
programming4us programming4us