why its not work?

Yairk_kaufmann 6 Reputation points
2021-03-07T17:56:19.38+00:00

i try to change the browser version and its not work

my code:

var k = 11001;
var n = System.Reflection.Assembly.GetExecutingAssembly().Location;

        Registry.SetValue("Computer/HKEY_CURRENT_USER/SOFTWARE/Microsoft/Internet Explorer/Main/FeatureControl/FEATURE_BROWSER_EMULATION", n + ".exe", k);
        Registry.SetValue("Computer/HKEY_CURRENT_USER/SOFTWARE/Microsoft/Internet Explorer/Main/FeatureControl/FEATURE_BROWSER_EMULATION", n + ".vshost.exe", k);
        Registry.SetValue("Computer/HKEY_CURRENT_USER/SOFTWARE/Wow6432Node/Microsoft/Internet Explorer/Main/FeatureControl/FEATURE_BROWSER_EMULATION", n + ".exe", k);
        Registry.SetValue("Computer/HKEY_CURRENT_USER/SOFTWARE/Wow6432Node/Microsoft/Internet Explorer/Main/FeatureControl/FEATURE_BROWSER_EMULATION", n + ".vshost.exe", k);

its say: The registry key name must begin with a valid base key name

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,834 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ken Tucker 5,846 Reputation points
    2021-03-07T18:15:51.937+00:00

    Two things you don't need to start with computer and you are using / instead of \

            Registry.SetValue("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Internet Explorer\\Main\\FeatureControl\\FEATURE_BROWSER_EMULATION", n + ".exe", k);
    
    1 person found this answer helpful.
    0 comments No comments