By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,356 Members | 1,023 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,356 IT Pros & Developers. It's quick & easy.

save regestry entries?

P: n/a
hy guys,

i tray to save regestry entries over an asp page. but i get the hole time
UnauthorizedAccessExceptions.
the code from the apsx.cs file is:

/// <summary>

/// Open or Create Sub Key in Registry.

/// </summary>

protected RegistryKey CreateRegistrySubKey(string path)

{

RegistryKey regKey = null;

try {regKey = Registry.LocalMachine.CreateSubKey(path);}

catch(ArgumentNullException) {return regKey;}

catch (ArgumentException) {return regKey;}

catch (UnauthorizedAccessException) {return regKey;}

return regKey;

}

public static path = "SOFTWARE\\settings";

do anybody knows why i have no access to the regestry? I am lock in as an
administrator.

wich best regards,

elmar


Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
The default ASPNET user account does not have permissions to edit the
registry.
You can give it permissions by following these steps:

1) Start Regedit.
2) Right click on a node and select "Permissions..."
3) Give the ASPNET account Full Control for that node. Under the advanced
button you can tell it to assign the same permissions to any child nodes as
well.

Or you can use impersonation to have ASP.NET run under a different user
account that has permissions to the registry.
Here's more info on impersonation:
http://msdn.microsoft.com/library/de...ersonation.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Elmar Jacobs" <el**********@target-instruments.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
hy guys,

i tray to save regestry entries over an asp page. but i get the hole time
UnauthorizedAccessExceptions.
the code from the apsx.cs file is:

/// <summary>

/// Open or Create Sub Key in Registry.

/// </summary>

protected RegistryKey CreateRegistrySubKey(string path)

{

RegistryKey regKey = null;

try {regKey = Registry.LocalMachine.CreateSubKey(path);}

catch(ArgumentNullException) {return regKey;}

catch (ArgumentException) {return regKey;}

catch (UnauthorizedAccessException) {return regKey;}

return regKey;

}

public static path = "SOFTWARE\\settings";

do anybody knows why i have no access to the regestry? I am lock in as an
administrator.

wich best regards,

elmar

Nov 18 '05 #2

P: n/a
hi steve,

thanks a lot. it work ;)
a additional information to the group:
the permission possibility you can only see in the regedit.exe or
regedt32.exe of the pc. not in the eVC reg editor tool.

thanks a lot,
elmar
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:Ok**************@TK2MSFTNGP12.phx.gbl...
The default ASPNET user account does not have permissions to edit the
registry.
You can give it permissions by following these steps:

1) Start Regedit.
2) Right click on a node and select "Permissions..."
3) Give the ASPNET account Full Control for that node. Under the advanced
button you can tell it to assign the same permissions to any child nodes
as
well.

Or you can use impersonation to have ASP.NET run under a different user
account that has permissions to the registry.
Here's more info on impersonation:
http://msdn.microsoft.com/library/de...ersonation.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Elmar Jacobs" <el**********@target-instruments.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
hy guys,

i tray to save regestry entries over an asp page. but i get the hole time
UnauthorizedAccessExceptions.
the code from the apsx.cs file is:

/// <summary>

/// Open or Create Sub Key in Registry.

/// </summary>

protected RegistryKey CreateRegistrySubKey(string path)

{

RegistryKey regKey = null;

try {regKey = Registry.LocalMachine.CreateSubKey(path);}

catch(ArgumentNullException) {return regKey;}

catch (ArgumentException) {return regKey;}

catch (UnauthorizedAccessException) {return regKey;}

return regKey;

}

public static path = "SOFTWARE\\settings";

do anybody knows why i have no access to the regestry? I am lock in as an
administrator.

wich best regards,

elmar


Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.