如何在 VB.NET 中使用 MSHTML?
在问题#56107的答案中, Erlend 提供了此示例 C# 代码:
using mshtml;
...
object[] oPageText = { html };
HTMLDocument doc = new HTMLDocumentClass();
IHTMLDocument2 doc2 = (IHTMLDocument2)doc;
doc2.write(oPageText);
我想在 VB.NET 中使用 mshtml,但 IDE 无法识别这一点:
Imports mshtml
我需要采取哪些附加步骤才能在 VB.NET 中使用 MSHTML?
In the answer to question #56107, Erlend provided this sample c# code:
using mshtml;
...
object[] oPageText = { html };
HTMLDocument doc = new HTMLDocumentClass();
IHTMLDocument2 doc2 = (IHTMLDocument2)doc;
doc2.write(oPageText);
I'd like to use mshtml in VB.NET, but the IDE doesn't recognize this:
Imports mshtml
What additional steps do I need to take to use MSHTML in VB.NET?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
找到了我自己的问题的答案:
ASP.NET 中的 MSHTML
有了这个线索,我通过打开“添加引用”对话框并在 COM 选项卡(而不是 .NET 选项卡)下查找找到了这一点。 它的组件名称是 Microsoft HTML Object Library。
Found an answer to my own question:
MSHTML in ASP.NET
With this clue, I found this by opening the "Add Reference" dialog, and looking under the COM tab, not the .NET tab. It's Component Name was Microsoft HTML Object Library.
导入 System.Runtime.InteropServices
“
有了这个线索,我通过打开“添加引用”对话框(项目==>添加引用)找到了这一点,并在 COM 选项卡下查找,而不是 .NET 选项卡。它的组件名称是 Microsoft HTML Object Library。”
100%有效
Imports System.Runtime.InteropServices
and
"With this clue, I found this by opening the "Add Reference" dialog(project==>Add Reference), and looking under the COM tab, not the .NET tab. It's Component Name was Microsoft HTML Object Library."
it work 100%