Re: writing to registry in vista from guest account
- From: "Cowboy \(Gregory A. Beamer\)" <NoSpamMgbworld@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 27 Jan 2009 10:28:38 -0600
The option I know is to reduce security on this particular hive so a user
can alter it. I am not sure this is wise. Better to put the configuration in
a config file, even if you have to encrypt it.
Another option is releasing the app as a web site or a click once
deployment, where it does not require registry access.
--
Gregory A. Beamer
MVP; MCP: +I, Se, SD, DBA
Blog:
http://feeds.feedburner.com/GregoryBeamer
*************************************************
| Think outside the box! |
*************************************************
"alexia" <alexia.bee@xxxxxxxxx> wrote in message
news:e5b4c34b-2a9b-4b97-9baa-8c9cf3b2bb4b@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
My application fails to write into registry key. When it runs in user/
guest account.
When I install my application in administrator, the installing process
creates reg key in HKLM.
I compile my application using manifest.
After the installation I create new user/guest account and runs the
application from that account.
The failure is when my application tries to write to the registry I
get the following error:
"Requested registry access is not allowed". I use the following code:
Note that I can read with no problem. My application doesn't fail in
administrator account.
try
{
// I get "Requested registry access is not allowed" error here...
RegistryPermission rm = new RegistryPermission
(RegistryPermissionAccess.AllAccess, TCPRoot);
rm.Demand();
}
catch (Exception e)
{
throw new Exception(e.Message);
}
RegistryKey myRegKey = Registry.LocalMachine;
myRegKey = myRegKey.OpenSubKey("SOFTWARE\\Giant Steps\\SLIP\\TCP",
RegistryKeyPermissionCheck.ReadWriteSubTree,
System.Security.AccessControl.RegistryRights.FullControl);
try
{
myRegKey.SetValue("Subnet", subnet);
}
catch (Exception e)
{
throw new Exception(e.Message);
}
Is there a way to write to a HKLM key which was created in admin
account from user/guest account?
Thanks.
.
- Follow-Ups:
- Re: writing to registry in vista from guest account
- From: alexia
- Re: writing to registry in vista from guest account
- References:
- writing to registry in vista from guest account
- From: alexia
- writing to registry in vista from guest account
- Prev by Date: Re: Who here knows ASP.NET in C#? Is this the right group?
- Next by Date: Re: Search Array
- Previous by thread: writing to registry in vista from guest account
- Next by thread: Re: writing to registry in vista from guest account
- Index(es):
Relevant Pages
|
Loading