繁体   English   中英

更改 WinHttpSettings 注册表值

[英]to change WinHttpSettings registry value

我正在尝试更改“WinHttpSettings”注册表值,但它给出了错误。 我试过如下

       RegistryKey OurKey = Registry.LocalMachine;
        //MessageBox.Show(OurKey.ToString());
        RegistryKey local = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections");
        string value = local.GetValue("WinHttpSettings").ToString();
        byte[] b ={ 1, 1, 1, 1 };
        if (value != null)
        {
            local.SetValue("WinHttpSettings",b);
            //MessageBox.Show(value.ToString());
        }

我在上述代码或任何其他解决方案中犯的任何错误

在注册表之前的值如下:

前

在做“史蒂夫 B”之后告诉改变:

 RegistryKey local = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections",true);

在此处输入图像描述

但我想要的是将第一个图像值更改为“0000”

更改此行:

RegistryKey local = Registry.LocalMachine.OpenSubKey(
    @"SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections",
    true
    );

特别是,请注意true作为第二个参数。 文档中所述,其用途是:

 writable Type: System.Boolean 
 Set to true if you need write access to the
 key.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM