N
Neal Rogers via .NET 247
Hi All
Using VB.Net
I have tried unsuccessfully (firstly with a Web App.. and IUSER_MachineName permissions ) to write to the registry.
So , now I've tried from a windows application, and same result
ie
key.SetValue("pwd", sValIn) ' = ERROR: cannot write to the registry key
("Run-time exception thrown : System.UnauthorizedAccessException - Cannot write to the registry key.")
I have set evry possible permission for every listed user on my machine to DenyNothing, and FullControl, and
in code set RegistryPermissions ..all the code is beneath.
Still, NO way I can write to registry
Anybody...???
TIA
Neal
Code....
'checks to see read functionality
key = Registry.CurrentUser.OpenSubKey("SOFTWARE\SPLUS\pwd")
key.GetValue("pwd")
Dim f As New RegistryPermission(RegistryPermissionAccess.AllAccess, _
"HKEY_CURRENT_USER\SOFTWARE")
f.AddPathList(RegistryPermissionAccess.Write, "HKEY_CURRENT_USER\SOFTWARE")
f.AddPathList(RegistryPermissionAccess.Write, "HKEY_CURRENT_USER\SOFTWARE\SPLUS")
f.AddPathList(RegistryPermissionAccess.Write, "HKEY_CURRENT_USER\SOFTWARE\SPLUS\pwd")
f.Assert()
key.SetValue("pwd", sValIn) 'cannot write to the registry key
Using VB.Net
I have tried unsuccessfully (firstly with a Web App.. and IUSER_MachineName permissions ) to write to the registry.
So , now I've tried from a windows application, and same result
ie
key.SetValue("pwd", sValIn) ' = ERROR: cannot write to the registry key
("Run-time exception thrown : System.UnauthorizedAccessException - Cannot write to the registry key.")
I have set evry possible permission for every listed user on my machine to DenyNothing, and FullControl, and
in code set RegistryPermissions ..all the code is beneath.
Still, NO way I can write to registry
Anybody...???
TIA
Neal
Code....
'checks to see read functionality
key = Registry.CurrentUser.OpenSubKey("SOFTWARE\SPLUS\pwd")
key.GetValue("pwd")
Dim f As New RegistryPermission(RegistryPermissionAccess.AllAccess, _
"HKEY_CURRENT_USER\SOFTWARE")
f.AddPathList(RegistryPermissionAccess.Write, "HKEY_CURRENT_USER\SOFTWARE")
f.AddPathList(RegistryPermissionAccess.Write, "HKEY_CURRENT_USER\SOFTWARE\SPLUS")
f.AddPathList(RegistryPermissionAccess.Write, "HKEY_CURRENT_USER\SOFTWARE\SPLUS\pwd")
f.Assert()
key.SetValue("pwd", sValIn) 'cannot write to the registry key