惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
博客园_首页
W
WeLiveSecurity
S
Secure Thoughts
S
Security @ Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Hugging Face - Blog
Hugging Face - Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
H
Hacker News: Front Page
Project Zero
Project Zero
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
U
Unit 42
N
News and Events Feed by Topic
N
News and Events Feed by Topic
Hacker News - Newest:
Hacker News - Newest: "LLM"
Forbes - Security
Forbes - Security
T
Tor Project blog
I
Intezer
B
Blog
F
Full Disclosure
Security Archives - TechRepublic
Security Archives - TechRepublic
F
Fortinet All Blogs
Schneier on Security
Schneier on Security
T
Threat Research - Cisco Blogs
AI
AI
Google DeepMind News
Google DeepMind News
L
LINUX DO - 最新话题
Cloudbric
Cloudbric
L
Lohrmann on Cybersecurity
WordPress大学
WordPress大学
博客园 - 聂微东
雷峰网
雷峰网
P
Privacy International News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
PCI Perspectives
PCI Perspectives
Y
Y Combinator Blog
Spread Privacy
Spread Privacy
Simon Willison's Weblog
Simon Willison's Weblog
罗磊的独立博客
Vercel News
Vercel News
A
Arctic Wolf
The Register - Security
The Register - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
H
Heimdal Security Blog
Know Your Adversary
Know Your Adversary
P
Proofpoint News Feed
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed

博客园 - 陈锐

微软社区发布会总结(多图杀猫) 微软 Visual Studio 2008 社区发布全国巡展长沙站预报 让微软出钱捐助难民吧 能够下载时改名的文件权限管理 你的博客的性别是什么? 湖南微软开发者俱乐部成立大会顺利召开 湖南微软.NET俱乐部 成立大会事宜 在VB.NET中如何使在Webbrowser中实现标签页中打开新链接 RichTextBox技巧之插入图片(转载) RichTextBox技巧之插入表格(转载) RichTextBox技巧之插入上标和下标(转载) RichTextBox技巧之显示自定义高亮显示(转载) RichTextBox技巧之插入带格式文本(转载) VB 2005的写作进度 再VB 2005的拖放式数据绑定时遇到的问题 写作进度(7月30日) Charles Petzold给撰书人的建议(from 思归的博客) 运行cl.exe编译发生:没有找到 mspdb80.dll 的解决办法 在VSTO 2005下创建的Office CommandBarButton不能定义在过程内
有些问题稍微想一下就明白了
陈锐 · 2006-08-09 · via 博客园 - 陈锐

写书要用到Webbrowser,但是Webbrowser没有提供查找功能,在网上找了一个VB 2003下面实现查找的代码:
http://support.microsoft.com/default.aspx?scid=kb%3Bzh-cn%3B311288
但是在运行时,在Find()函数中的cmdt = CType(GetDocument(), IOleCommandTarget)报错,错误信息是:
Cannot retrieve the document from the WebBrowserControl: Unable to cast object of type 'System.Windows.Forms.HtmlDocument' to type 'MSHTML.HTMLDocument'.
分析了一下是GetDocument()中的Dim htm As mshtml.HTMLDocument = AxWebBrowser1.Document转换出现的错误。
在微软动力营里面发了一个帖子想到,既然VB 2005中的Webbrowser中的Document是 System.Windows.Forms.HtmlDocument
类型,那么它应该还有一个从这个类型到DOM的转换,这样就不会出错了,找了一下,果然Document对象有一个DomDocument
属性,将AxWebBrowser1.Document转换为AxWebBrowser1.Document.DomDocument就可以了。