G
Guest
I have Visual Studio 2005 Express Edition. I am trying to change registry
value by:
RegistryKey key = Registry.CurrentUser.OpenSubKey("Software\\My_app");
key.SetValue(name_of_value, new_value_string);
I am getting error:
System.UnauthorizedAccessException: Cannot write to the registry key.
at System.ThrowHelper.ThrowUnauthorizedAccessException(ExceptionResource
resource)
at Microsoft.Win32.RegistryKey.SetValue(String name, Object value,
RegistryValueKind valueKind)
at Microsoft.Win32.RegistryKey.SetValue(String name, Object value)
at MyApp.Form1.MyFunction(String data, String name_of_value) in
C:\Documents and Settings\Admin\MyApp\MyApp\Form1.cs:line 70
what is wrong?
value by:
RegistryKey key = Registry.CurrentUser.OpenSubKey("Software\\My_app");
key.SetValue(name_of_value, new_value_string);
I am getting error:
System.UnauthorizedAccessException: Cannot write to the registry key.
at System.ThrowHelper.ThrowUnauthorizedAccessException(ExceptionResource
resource)
at Microsoft.Win32.RegistryKey.SetValue(String name, Object value,
RegistryValueKind valueKind)
at Microsoft.Win32.RegistryKey.SetValue(String name, Object value)
at MyApp.Form1.MyFunction(String data, String name_of_value) in
C:\Documents and Settings\Admin\MyApp\MyApp\Form1.cs:line 70
what is wrong?