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?
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