2011-07-06 43 views
0

「WinHttpSettings」レジストリ値を変更しようとしていますが、エラーが発生しています。スティーブB」を行った後WinHttpSettingsレジストリ値を変更する

before

:私は、レジストリの値は以下のようである前に、私は上記のコードや他のソリューション

で行わ

 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()); 
     } 

以下のどれ間違いのように試してみました告げられた変更:

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

、特に

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

第二引数としてtrueに気づく:0

私が望んでいたが '0000'

+0

エラーは何ですか。 –

+0

'レジストリキーに書き込めません。' – deepi

答えて

0

変化としてこのラインを第一の画像の値を変更することです。 documentationで説明されているように、その使用は次のとおりです。

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

今度は値を '0 * 00000000(1)'に変更しましたが、値を '0000'に変更したい、つまり16進数の値がある前に値を変更したいと考えています。 – deepi

+0

あなたの目標を理解できません。 4バイトではなく、4バイトで何を書いていますか? –

+0

私はそれを編集した質問を参照してください – deepi

関連する問題