VB.net by js call window. The external method below
Time:10-23
I recently doing a video dialogue function, the video dialogue function mainly is divided into two parts, the server and client, server ASP.NET development, web page nested a program written in VC, used to invoke the video dialogue Actix controls, Basic run through the server now, now the main problem on the client, the client is written in VB.NET, I in the video page defines a WebBrowser, through WebBrowser calls a static page, external JS calls via a web page. The XXX to invoke the local registered com components, but said there is no external attributes, It is code:
Page code Public Class Form1
Private Sub Button1_Click (ByVal sender As System. Object, ByVal e the As System. EventArgs) Handles for. Click
Dim fileContents As String FileContents=My.Com puter. FileSystem. ReadAllText (Application. StartupPath & amp; "\ error1 HTML")
WebBrowser1. DocumentText=fileContents WebBrowser1. ObjectForScripting=Me WebBrowser1. Navigate (Application. StartupPath & amp; "\ error1 HTML") End Sub
Private Sub Button2_Click (ByVal sender As System. Object, ByVal e the As System. EventArgs) Handles Button2. Click Dim param () As the Object=New Object () {" hello ", "pig eight quit"} WebBrowser1. Document. InvokeScript (" StartUp ") End Sub
The End of the Class
HTML page JS code: The function StartUp () { Var strAdmin="admin"; Var strPwd="698 d51a19d8a121ce581499d7b701668"; Var strIp="192.168.0.55"; Var strConf="Shanghai fire corps"; External StartUpAv (strAdmin strPwd, strIp, strConf, 1); } The function of hallo (ss, name) { Alert (ss + name); } The function sayHallo () { Alert (window. External); Window. The external. The Test (" hello ", 15); } </script>
Can you tell me where the problem is?
CodePudding user response:
I use VB6 webbrowser, in their own applications is can receive to the window. The external. The method name (parameters) Is the interface to realize the webbrowser in principle, I don't know. How to use in the net,