[VB.NET]AxWebBrowser超奇怪问题,发布到客户机获取不了AxWebBrowser1.Document
来源:互联网 发布:淘宝热力图 编辑:程序博客网 时间:2024/04/29 21:00
<script type="text/javascript"><!--google_ad_client = "pub-8333940862668978";/* 728x90, 创建于 08-11-30 */google_ad_slot = "4485230109";google_ad_width = 728;google_ad_height = 90;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
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.
__________________________________________________________________________
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.
__________________________________________________________________________
- [VB.NET]AxWebBrowser超奇怪问题,发布到客户机获取不了AxWebBrowser1.Document
- [VB.NET]打包后有个很奇怪的问题
- [VB.NET]插入数据到数据库问题!!
- 关于document.getElementsByName的奇怪问题
- [VB.NET]发布应用程序
- VB.NET 程序发布
- vb.net 发布失败
- [VB.NET]vb升级到vb.net
- [VB.NET]一个关于VB2005中 listbox的奇怪的问题
- 关于axwebbrowser控件的问题
- VB升级到VB.NET
- 从VB到VB.NET
- VB.net获取屏幕分辨率
- .Net比较奇怪的问题
- vb.net程序打包发布
- 彻底解决VB.NET获取网页源代码的问题
- [VB.NET]急!!!WebBrowser的问题,超郁闷,麻烦大家来帮帮忙
- ASP.NET获取客户机IP和MAC地址
- [VB.NET]richtextbox控件
- STL非修改算法
- StreamWriter输出中文乱码的问题
- [VB.NET]vs 2005 性能 测试?
- [VB.NET]请教!!!!关于删除记录的问题......
- [VB.NET]AxWebBrowser超奇怪问题,发布到客户机获取不了AxWebBrowser1.Document
- bnu1058 连连看游戏 C语言版
- java的输入输出入门
- JavaFX中effect包中Blend类简单使用
- [VB.NET]vb2005卸载窗体问题
- Tcl字符串总结
- [VB.NET]急死!2005中如何更新数据源,老鸟帮帮手,立马揭帖
- [VB.NET]DataGrid怎样显示数据表中数据
- bnu1059 星际争霸之单挑 C语言版