打开 IE 并读取 IE 7 或更高版本的页面 c#
我需要打开给定 URL 的浏览器(Internet Explorer 7 或更高版本),然后在加载完成后读取内容。让浏览器保持打开状态,供用户随后正常使用。
然后,如果需要,我需要稍后用新的 URL 替换该页面(如果仍然打开)并阅读该页面...
因为在阅读该页面后我需要将它们保留在 IE 中,所以我认为我无法使用浏览器控件,那么我该怎么做呢?
这是一个使用 .Net4 的 Windows 经典表单应用程序。
非常感谢。
I need to open a browser (Internet Explorer 7 or above) for a given URL and then read the contents once it has finished loading. leaving the browser open for the user to use as normal afterwards.
Then I need to replace the page (if still open) with a new URL later if needed and read that page...
As I'm needing to leave them in IE after I have read the page I assume I can't use the browser control, so how would I do this?
This is a windows classic forms app using .Net4.
many thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是可以做到的。查看 http://www.codeproject.com/KB/shell/AutomateShellWindow.aspx
一旦您有权访问
IWebBrowser2
,您就可以执行您需要的一切操作,包括导航、阅读内容等。It can be done. Look http://www.codeproject.com/KB/shell/AutomateShellWindow.aspx
Once you have access to
IWebBrowser2
you can do everything you need, including navigate, read content etc.