Use latest version of Internet Explorer in the webbrowser control

后端 未结 13 1396
长发绾君心
长发绾君心 2020-11-21 23:29

The default version of the webbrowser control in a C# Windows Forms application is 7. I have changed to 9 by the article Browser Emulation, but how is it possible t

13条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-22 00:09

    You can try this link

    try
    {
        var IEVAlue =  9000; // can be: 9999 , 9000, 8888, 8000, 7000
        var targetApplication = Processes.getCurrentProcessName() + ".exe"; 
        var localMachine = Registry.LocalMachine;
        var parentKeyLocation = @"SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl";
        var keyName = "FEATURE_BROWSER_EMULATION";
        "opening up Key: {0} at {1}".info(keyName, parentKeyLocation);
        var subKey = localMachine.getOrCreateSubKey(parentKeyLocation,keyName,true);
        subKey.SetValue(targetApplication, IEVAlue,RegistryValueKind.DWord);
        return "all done, now try it on a new process".info();
    }
    catch(Exception ex)
    {
        ex.log();
        "NOTE: you need to run this under no UAC".info();
    }
    

提交回复
热议问题