最近要写Excel插件,因为VB6比较熟,于是选了VB.NET,比较容易上手些。
采用WebBrowser打开网页。涉及到网页完成一系列操作后,点确定后通知插件已经完成了操作。
测试代码如下:
vb.net
Imports System.Runtime.InteropServices
<ComVisible(True)>
Public Class Form1
Public Sub openUrl(ByVal url As String)
Me.WebBrowser1.ObjectForScripting = Me
Me.WebBrowser1.Navigate(url)
End Sub
Public Sub Showmsg()
MsgBox("6")
End Sub
End Class
jsp
function excel(){
window.external.Showmsg();
}