Mattias,
It still doesn't work..
private string sSubKey =
@"Software\Microsoft\Windows\CurrentVersion\Intern et Settings\P3P\History\";
public void AddBlockCookies()
{
foreach(string x in strBlkCookiesLst)
{
RegistryKey Key = Registry.CurrentUser;
using (Key.CreateSubKey(sSubKey + x +
@"\"))Key.SetValue(null,Convert.ToInt32(00000005)) ;
Key.Close;
}
}
Also tried
using (Key.OpenSubKey(sSubKey + x +
@"\"))Key.SetValue(null,Convert.ToInt32(00000005)) ;
But since I have to create the key first to get this to work the default
value is already created, that's why I went to the first idea.
"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Indeed you're right, you can change the default value type. My
mistake.
Surely if VBS can do this C# can?
Yep
string key = @"Software\Microsoft\Windows\CurrentVersion" +
@"\Internet Settings\P3P\History\doubleclick.com";
using ( RegistryKey k = Registry.CurrentUser.OpenSubKey( key, true ) )
k.SetValue( null, 5 );
Mattias
--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.