473,796 Members | 2,740 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 RegistryPermiss ion 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 1417
Hello, ma***********@g mail.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 RegistryPermiss ion 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...@g mail.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/SecureRegistryK ey.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?

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

Sep 3 '07 #3
Hello, ma***********@g mail.com!

RegistryPermiss ion 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...@g mail.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/SecureRegistryK ey.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?

mRegistryPermis sion 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
4092
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 to a handle to the following pipe: \Device\LanmanRedirector\<MACHINE>\PIPE\winreg Even after explicitly calling Close() (which, according to the docs, should not matter for a base key), and expliticly doing garbage collections, I cannot seem...
6
1856
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 (i.e. when the database closes, then the number in the table is decremented. I plan to use this on a front/back end setup, with a number of front end users on the network. What i'm concerned about is if for some reason the network fails, and the...
0
2854
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 item) third, I disconnect the network drive connection it works great the first time but if i run it again on the same pc anytime after that I get the following
0
3270
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 NT\CurrentVersion\HotFix but I get a permissions error when I try to access HKLM\Software\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx. The security permissions are identical on these two keys. Here is my code: RegistryKey...
1
3385
by: Brian Keating | last post by:
Hi there anyone know to the get the native registry Handle from a RegistryKey? thanks in advance
16
1993
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 the database and at that point I can no longer access the database with my web app. Is there anyway around this? All I need is read only access to the database to get some report information to display on the web page. The error I get on the...
7
5516
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 will have to do with the proper registration and purchase of the program. I have the following code in my program: Public Sub SetRegValue(ByVal ValueName As String, ByVal TestValue As Boolean) Dim f As New...
3
1781
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 esoteric uses (abuses?) of the language. I've been working from the oft quoted resource http://www.crockford.com/javascript/private.html. During my first serious attempt at using the knowledge acquired from this page, I ran up against the problem...
20
3803
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 that particular key. Example:
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9535
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10467
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10201
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10021
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5454
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2931
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.