Home > Software engineering >  VB.net by js call window. The external method below
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,

CodePudding user response:

reference 1st floor vansoft 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 the.net,


Can you look? Refer to [email protected]

CodePudding user response:

reference 1st floor vansoft 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 the.net,


Vb6 zha get ah, is there a code? The complete

CodePudding user response:

reference xiaoyao961 reply: 3/f
Quote: refer to 1st floor vansoft 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 the.net,


Vb6 zha get ah, is there a code? The complete


http://blog.csdn.net/vansoft/article/details/3547261

CodePudding user response:

refer to the second floor la0475 response:
Quote: refer to 1st floor vansoft 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 the.net,


Can you look? Validate [email protected]


http://blog.csdn.net/vansoft/article/details/3547261

CodePudding user response:

VB6 realize separation of interface and function code, what's the use? If just for the sake of separation
Something on the web, for example on the execution of corresponding software function, then just use a & lt; It is ok that a HREF
According to different links to perform different functions, and the page will not switch to another interface
For example, http://www.baidu.com/#3 # 4
The principle of type of this kind of label

CodePudding user response:

reference 1st floor vansoft 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 the.net,


With Implements IDocHostUIHandler this can be, but he himself of the LIB is the 500 k, I prepared programs may just 50 k olelib this library is too big, if can directly using VB to achieve, it is not necessary to use other components, or if you don't know the component, not cannot be achieved?

Now, I encounter a problem is that JAVASCRIPT call an internal function, can intercept in VB off for good, so is there a way to deal with,

For a web page have a method: external HelloWorld ();
Once the execution, VB could be intercepted
Private WithEvents Doc As HTMLDocument


Private Sub WebBrowser1_DocumentComplete (ByVal pDisp As Object, the URL As the Variant)
The Set of Doc=WebBrowser1. Document

End Sub

This has a lot of events, the onclick, etc., is that I don't know which one is ONscript run (script), there is the very simple

CodePudding user response:

The
Quote: refer to the original poster wanghongli5201314 response:








I am now using this method, it took me this way, then you can not need olelib the TLB library, that is to say, if the external are written yourself, then use my completely can be done, but if the call without runcommand (' this way, it would not

Pure such a word, I am unable to perform: external. The HelloWorld ()

CodePudding user response:

reference 5 floor vansoft reply:
Quote: refer to the second floor la0475 response:

Quote: refer to 1st floor vansoft 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 the.net,


nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related