Hi ,
I am trying to change the datavalue of a registry key using dotnet c#

The code i use is as follows
RegistryKey key = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Shared Tools\\Web Server Extensions\\12.0\\WSS");
if (key != null)
{
key.SetValue("SetupType","V2V_INPLACE_UPGRADE");
f1.Logger("Registry value in the key SetupType is succesfully set as V2V_INPLACE_UPGRADE");
}
How ever i am not able to set the value as an unhandled exception gets thrown UnauthorisedAccessException saying i dont have the access privileges .
how ever i am the administrator and i am able to change the registry settings manually .

kindly help me out regarding this .

Thanks in advance
have a nice day