IHTMLDocument2 引用

z2394945062 2012-05-28 07:50:44
看到用户 caozhy 如下 关于获取选中的文本的代码


IHTMLDocument2 document = (IHTMLDocument2)webBrowser1.Document.DomDocument;
IHTMLTxtRange htmlElem = (IHTMLTxtRange)document.selection.createRange();
string s = htmlElem.InnerText;



请教 C# 如何引用 IHTMLDocument2 ?
哪个命名空间 或要引用 哪个程序集?

...全文
319 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
孟子E章 2012-05-28
  • 打赏
  • 举报
回复
在COM中,选择Microsoft.mshtml

要是浏览的话,找mshtml
z2394945062 2012-05-28
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 的回复:]

引用COM浏览
mshtml.dll
[/Quote]

是mshtml.dll
还是 Microsoft.mshtml.dll
这里(C:\Program Files\Microsoft Visual Studio 9.0\Visual Studio Tools for Office\PIA\Office11\Microsoft.mshtml.dll)

为什么我添加了后没有反应呢?




孟子E章 2012-05-28
  • 打赏
  • 举报
回复
引用COM浏览
C:\WINDOWS\system32\mshtml.dll

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧