473,386 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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
3 1405
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: geek_in_a_box | last post by:
I seem to be experiencing a behavior on Framework 1.0 sp2 RegistryKey class where the class is not releasing/closing named pipe winreg handles to remote machines. The process continues to hold on...
6
by: Gerry Abbott | last post by:
Hi all, Have written some code to limit the concurrent users of a database. Use the Autoexec macro to open a form. When the form opens it increments a value in a table. When the form closes...
0
by: csharp_helpwanted | last post by:
steps.. first, I'm creating a connection by mapping a network drive to the pc second, the map drive connection was successful I try to read a certian registry key/value (that is a valid reg...
0
by: g82martin | last post by:
I am using the RegistryKey class to access the registry on remote machines. I only require read access. I am able to successfully read registry keys under HKLM\Software\Microsoft\Windows...
1
by: Brian Keating | last post by:
Hi there anyone know to the get the native registry Handle from a RegistryKey? thanks in advance
16
by: JonnyD | last post by:
I am working on a project to build a reporting web app from an exsiting database that is controled by a local application. The application that has control over the database creates a lock file to...
7
by: Vernon Peppers | last post by:
I am a newbie with .NET, trying to step up from VB6. I have a need to write to and read from the registry. Config files will not be acceptable due to their lack of security. The registry entry...
3
by: rickeringill | last post by:
Hi comp.lang.javascript, I'm throwing this in for discussion. First up I don't claim to be any sort of authority on the ecmascript language spec - in fact I'm a relative newb to these more...
20
by: Newbie Coder | last post by:
MFC Application VC++.NET 2003 I have a certain registry key (HKCU\Software\MyKey) that contains between 30 & 64 string values I need to write a '*' to all those 30 - 64 string values under...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.