[VB.NET]AxWebBrowser超奇怪问题,发布到客户机获取不了AxWebBrowser1.Document

AxWebbrowser超奇怪问题,发布到客户机获取不了AxWebbrowser1.Document 很简单的代码,打开窗口后点击AxWebbrowser1中显示的网页中的内容,弹出点击的网页元素的text,在装了.net开发环境的机器上都能弹出msgBox,但是在客户没装.net开发环境的机器上能显示网页点击却弹不出msgBox,客户机器已经装了.net framework,然后我在客户机器上装了.net 2003就行了,卸载了又不行了,总不能让每个客户机器装.net 2003吧,恳求高手给出解决方案,代码如下: Private Sub Form1_Load(ByVal sender As Object,ByVal e As System.EventArgs) Handles MyBase.Load Me.AxWebbrowser1.Navigate( http://10.11.11.1/ ) End Sub Private Sub AxWebbrowser1_NavigateComplete2(ByVal sender As Object,ByVal e As AxSHDocVw.DWebbrowserEvents2_NavigateComplete2Event) Handles AxWebbrowser1.NavigateComplete2 must wait for this event to grab a valid refernece to the Document property MessageBox.Show( add event ) Dim doc As mshtml.HTMLDocument = DirectCast(AxWebbrowser1.Document,_ mshtml.HTMLDocument) Cast to the interface that defines the event you re interested in Dim docevents As mshtml.HTMLDocumentEvents2_Event = DirectCast(doc,_ mshtml.HTMLDocumentEvents2_Event) Define a handler to the onclick event AddHandler docevents.onclick,AddressOf onclickproc End Sub Private Function onclickproc(ByVal obj As mshtml.IHTMLEventObj) As Boolean an object on the page has been clicked - you can learn more about type and position of this object by querying the obj s properties ... Dim name As String name = obj.srcElement.innerText MessageBox.Show(name) End Function __________________________________________________________________________ 你的安装程序没有安装mshtml到GAC吧 __________________________________________________________________________ 怎么安装mshtml到GAC?是在编译的时候选吗?我编译好之后有一个除了exe文件外又复制了AxInterop.SHDocVw.dll和Interop.SHDocVw.dll __________________________________________________________________________ 用webbrowser就行了, 不要用AxWebbrowser __________________________________________________________________________ 我用的2005 __________________________________________________________________________ 我用的是.net 2003,在com组件中选择的ms webbrowser放到界面上就是AxWebbrowser,怎么办呢?哪里有webbrowser呢? __________________________________________________________________________ Check your {program files}/Microsoft.NET/Primary Interop Assemblies directory - there should be a 8+ MB large file Microsoft.mshtml.dll,which you ll also need to install onto the application directory in order for MSHTML stuff to work. __________________________________________________________________________

相关文章

Format[$] ( expr [ , fmt ] ) format 返回变体型 format$ 强...
VB6或者ASP 格式化时间为 MM/dd/yyyy 格式,竟然没有好的办...
在项目中添加如下代码:新建窗口来显示异常信息。 Namespace...
转了这一篇文章,原来一直想用C#做k3的插件开发,vb没有C#用...
Sub 分列() ‘以空格为分隔符,连续空格只算1个。对所选...
  窗体代码 1 Private Sub Text1_OLEDragDrop(Data As Dat...