在 Windows 7 中以管理员身份运行 Visual Studio 以与 Internet Explorer 交互 [英] Get around running visual studio as administrator in Windows 7 to interact with Internet Explorer

查看:24
本文介绍了在 Windows 7 中以管理员身份运行 Visual Studio 以与 Internet Explorer 交互的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 SHDocVw.InternetExplorerClass 来抓取网页.它在 XP 中运行良好,但是当我尝试在 Windows 7 中运行它时出现错误:

I'm using SHDocVw.InternetExplorerClass to scrape a webpage. It works fine in XP, but when I try to run it in windows 7 I get an error:

接口未知.(来自 HRESULT 的异常:0x800706B5)

当我以管理员模式运行 Visual Studio 时,它工作正常,但发布的应用程序也必须以管理员模式运行,这是不可接受的.

When I run visual studio in administrator mode it works fine, but the published application has to be run in administrator mode too, which isn't acceptable.

有什么办法可以绕过在管理员模式下运行应用程序吗?

Is there any way to get around running the application in administrator mode?

推荐答案

你绝对需要使用 SHDocVw.InternetExplorerClass 进行抓取吗?您可以使用 System.Net.WebClientHttpWebRequest 发送常规 HTTP Web 请求吗?这些是首选方式.如果您需要执行 JavaScript 或 VBScript 等脚本技术,您通常应该只使用 SHDocVw.InternetExplorerClass 进行抓取.

Do you absoltely need to use SHDocVw.InternetExplorerClass for scraping? Can you just send regular HTTP web requests using System.Net.WebClient or HttpWebRequest? These are the preferred ways. You generally should only use SHDocVw.InternetExplorerClass for scraping if you need to execute scripting technologies like JavaScript or VBScript.

这篇关于在 Windows 7 中以管理员身份运行 Visual Studio 以与 Internet Explorer 交互的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆