S
Steve
When attempting to access the Registry, I receive errors.
I have attempted to add code to assert access to the key,
but this does not help. The documentation on accessing
the Registry is pathetic.
Dim rp As New
System.Security.Permissions.RegistryPermission
(Security.Permissions.RegistryPermissionAccess.AllAccess,
"HKEY_CURRENT_USER\SOFTWARE\MyApplication")
oKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey
("Software").OpenSubKey("MyApplication").OpenSubKey
("Database")
oKey.SetValue("Databases", "1")
Error Message:
An unhandled exception of
type 'System.UnauthorizedAccessException' occurred in
mscorlib.dll
Additional information: Cannot write to the registry key.
I have attempted to add code to assert access to the key,
but this does not help. The documentation on accessing
the Registry is pathetic.
Dim rp As New
System.Security.Permissions.RegistryPermission
(Security.Permissions.RegistryPermissionAccess.AllAccess,
"HKEY_CURRENT_USER\SOFTWARE\MyApplication")
oKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey
("Software").OpenSubKey("MyApplication").OpenSubKey
("Database")
oKey.SetValue("Databases", "1")
Error Message:
An unhandled exception of
type 'System.UnauthorizedAccessException' occurred in
mscorlib.dll
Additional information: Cannot write to the registry key.