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

StackOverflow https://stackoverflow.com/questions/6348730

  •  27-10-2019
  •  | 
  •  

سؤال

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top