[英]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.