Get around running visual studio as administrator in Windows 7 to interact with Internet Explorer

家住魔仙堡 提交于 2019-12-07 11:56:55

问题


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:

The interface is unknown. (Exception from HRESULT: 0x800706B5)

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?


回答1:


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.



来源:https://stackoverflow.com/questions/6348730/get-around-running-visual-studio-as-administrator-in-windows-7-to-interact-with

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!