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

How can set that both limited users and privileged users can write to a registrykey in c#

P: n/a
How can I set write permissions for a limited user to write values to
a certain registrykey. This registrykey is also written to by a
administrator (which probably also created the key in the first
place).
I have looked at the RegistryPermission class but would really like to
see a code sample on this.

How can it be done, simplest way possible?

thanx

Sep 3 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hello, ma***********@gmail.com!

To secure separate registy key, you need to setup Access Control List (ACL)
on that key.

Here's the example how to set ACL on the files -
http://west-wind.com/weblog/posts/4072.aspx.
The same is valid for registry keys.

Here's also the example in MC++ -
http://www.codeproject.com/dotnet/SecureRegistryKey.asp

--
With best regards, Vadym Stetsiak.
Blog: http://vadmyst.blogspot.com

You wrote on Mon, 03 Sep 2007 00:34:05 -0700:

mHow can I set write permissions for a limited user to write values to
ma certain registrykey. This registrykey is also written to by a
madministrator (which probably also created the key in the first
mplace).
mI have looked at the RegistryPermission class but would really like
mto see a code sample on this.

mHow can it be done, simplest way possible?

mthanx
Sep 3 '07 #2

P: n/a
On 3 Sep, 12:33, "Vadym Stetsiak" <vadm...@gmail.comwrote:
Hello, marcussilf...@gmail.com!

To secure separate registy key, you need to setup Access Control List (ACL)
on that key.

Here's the example how to set ACL on the files -http://west-wind.com/weblog/posts/4072.aspx.
The same is valid for registry keys.

Here's also the example in MC++ -http://www.codeproject.com/dotnet/SecureRegistryKey.asp
Thanks for answering, however I have to use .Net 1.1 so the solution
described in the first link is not available to me unfourtunately.
I have not looked so much on the 2nd link yet, but I guess I could use
that unmanaged code for the task.

I rather do it purely in c# though (if possible)

Is there a way to enable a limited user to write to a certain
registrykey in c# in .Net 1.x or do I have to resort to unmanaged code
for this when developing .Net 1.x applications?

RegistryPermission class exist in .Net 1.x could this class solve this
issue?

Sep 3 '07 #3

P: n/a
Hello, ma***********@gmail.com!

RegistryPermission won't help you, since they're regulate registry
permissions within your code, and not in the OS.

IMO the only way left is the unmanaged way (see link 2 from the previous
answer)

You wrote on Mon, 03 Sep 2007 04:43:58 -0700:

mOn 3 Sep, 12:33, "Vadym Stetsiak" <vadm...@gmail.comwrote:
>Hello, marcussilf...@gmail.com!
>To secure separate registy key, you need to setup Access Control List
(ACL)
on that key.
>Here's the example how to set ACL on the files
-http://west-wind.com/weblog/posts/4072.aspx.
The same is valid for registry keys.
>Here's also the example in MC++
-http://www.codeproject.com/dotnet/SecureRegistryKey.asp

mThanks for answering, however I have to use .Net 1.1 so the solution
mdescribed in the first link is not available to me unfourtunately.
mI have not looked so much on the 2nd link yet, but I guess I could
muse that unmanaged code for the task.

mI rather do it purely in c# though (if possible)

mIs there a way to enable a limited user to write to a certain
mregistrykey in c# in .Net 1.x or do I have to resort to unmanaged
mcode for this when developing .Net 1.x applications?

mRegistryPermission class exist in .Net 1.x could this class solve
mthis issue?

--
With best regards, Vadym Stetsiak.
Blog: http://vadmyst.blogspot.com
Sep 3 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.