问题
Regarding this thread, I need to change the UserAgent programatically (from a C# code) of a IE11 instance. I use automation (COM Internet Explorer Object):
SHDocVw.InternetExplorer IE = new SHDocVw.InternetExplorer()
As IE instances do not run in-process, using urlmon´s "UrlMkSetSessionOption" does not change UA used by iexplore.exe On the other side, add-on of EricLawrence does not allow to set programatically the new UA.
Any solution?
回答1:
Eric has been very polite and he has showed me that add-on uses a registry value called "OverrideUA" in order to have a persistent configuration- That allows a programatic setting from an external code. Thead may be closed
来源:https://stackoverflow.com/questions/52691479/change-ie-com-object-useragent