Change IE COM object UserAgent

 ̄綄美尐妖づ 提交于 2019-12-25 04:09:08

问题


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

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