WPF WebBrowser Browser Version

前端 未结 2 1729
粉色の甜心
粉色の甜心 2021-01-05 05:38

Does the WPF WebBrowser control depend on the version of IE that is installed on the user\'s machine, or does it use a separate library that is consistent across machines?

2条回答
  •  抹茶落季
    2021-01-05 06:18

    I created a WPF app with a WebBrowser Control on a machine with IE11 and got this user agent string:

    user agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3; .NET CLR 1.1.4322)
    

    I created a WPF app with a WebBrowser Control on a machine with IE10 and got this user agent string:

    user agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)
    

    Trident/7.0 indicates IE11 and Trident/6.0 indicates IE10. More about user-agent strings.

    The system with IE10 also had the page render differently than the system with IE11. I also verified this with the standalone IE browsers on each system.

    I've yet to try it on a system WITHOUT IE or a system running IE6, but it seems that WebBrowser control is related to the version of IE currently installed on the system.

提交回复
热议问题