On a Form Put a Command1, Command2, and a WebBrowser control. Copy and Paste the below code to the project
Command1.Caption = Load Html
Command2.Caption = Click Button
Copy and Paste below code to a text document and save it as JavaScript.htmlCode:Private Sub Command1_Click() WebBrowser1.Navigate App.Path & "\JavaScript.html" End Sub Private Sub Command2_Click() WebBrowser1.Document.All("myButton").Click Results = WebBrowser1.Document.All("a3").Value MsgBox Results End Sub Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant) Dim Results As String If URL = App.Path & "\JavaScript.html" Then WebBrowser1.Document.All("a1").Value = "Wilson" WebBrowser1.Document.All("a2").Value = "22402240" WebBrowser1.Document.All("myButton").Click MsgBox WebBrowser1.Document.All("a3").Value End If End Sub
Run the projectCode:function address() { var s = ""; var t = ""; var len = 0; var i = 0; var n = 0; var p = 0; var code = 0; var ARG3 = ""; var alphanum="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; s = "Wilson" t = "22402240" var address = "r"; //var len, i, n, p, code len = (s.length > t.length) ? s.length : t.length; //alert("len = (s.length > t.length) ? s.length : t.length ---> len = " + len); if(len > 24) { len = 24; } for(i = 0; i < len; i++) { //alert("for(i = 0; i < len; i++) ---> i = " + i); n = p = 0; //alert("at n = p = 0 ---> n = " + n + ", p = " + p); if(i < s.length) { n = alphanum.indexOf(s.substring(i, i + 1)); //alert("in if(i < s.length) ---> n = " + n); } if(i < t.length) { p = alphanum.indexOf(t.substring(i, i + 1)); //alert("in if(i < t.length) ---> p = " + p); } if(n < 0) { n = 0; } if(p < 0) { p = 0; } code = ((2*n+p) ^ 13) % (alphanum.length - 1); //alert("code = ((2*n+p) ^ 13) % (alphanum.length - 1) ---> code = " + code); if(code > 0) { address += alphanum.substring(code, code + 1); //alert("address += alphanum.substring(code, code + 1) ---> address = " + address); } } Arg3 = address; alert("Arg3.Value = " + Arg3); //document.write(address); // + "<br />"); }




Reply With Quote