473,321 Members | 1,622 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,321 software developers and data experts.

Reading registry key throws "Requested registry access is not allowed."

HK
I am exceuting the following command in C#

using Microsoft.Win32;

RegistryKey key = Registry.LocalMachine.OpenSubKey(KeyName);

I keep getting the exception "Requested registry access is not
allowed."

If i give EVERYONE full access to the key , then i am able open the
key but i do not want to do that.
Please help.
Nov 18 '05 #1
1 3433
Give the ASP.NET process access as well as the IUSR account. Either that or
assign a user for the thread before making the call.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** ********************
Think Outside the Box!
************************************************** ********************
"HK" <ju*******@yahoo.com> wrote in message
news:2e**************************@posting.google.c om...
I am exceuting the following command in C#

using Microsoft.Win32;

RegistryKey key = Registry.LocalMachine.OpenSubKey(KeyName);

I keep getting the exception "Requested registry access is not
allowed."

If i give EVERYONE full access to the key , then i am able open the
key but i do not want to do that.
Please help.

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Joao Santa Barbara | last post by:
Hi all i have this error reading one registry key , can anyone assist me .. please very urgent i try in one computer, and work fine, but in other computer it didn´t work and throws this error...
3
by: Daniel | last post by:
If my System.IO.StreamWriter Write method throws "The specified network name is no longer available." and I try to Dispose or Close it in the finaly clause the close or dispose method just throws...
6
by: John Hoffman | last post by:
Reading registry: .... RegistryKey rksub = rkey.OpenSubKey(s); String valstr = rksub.GetValueNames(); foreach (String vs in valstr) { String vstr = rksub.GetValue(vs).ToString(); OR String...
0
by: John Hoffman | last post by:
reading registry through keys to get to key/values, .... String valstr = rksub.GetValueNames(); foreach (String vs in valstr) { String vstr = rksub.GetValue(vs).ToString(); // EXCEPTION...
3
by: [Yosi] | last post by:
I have some unreasonable issue while reading access component from other thread. I have a Form class which includes TreeView, this tree view includes some TreeNodes , lets say 2 . In my Form...
2
by: Boris Fortes | last post by:
I need to unhook event receiver as result of native C++ event. It unhooks successfully, but __raise does not return and throws access violation. Visual Studio 2003 How to reproduce: Consol...
1
by: HK | last post by:
I am exceuting the following command in C# using Microsoft.Win32; RegistryKey key = Registry.LocalMachine.OpenSubKey(KeyName); I keep getting the exception "Requested registry access is not...
3
by: JB | last post by:
I am trying to access a registry key on computer like so: key = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, computerName).OpenSubKey(Subkey); There are two keys I am trying to...
2
by: sbasavar | last post by:
Hi All, In my excel programming, I am using XML http object (MSXML2.XMLHTTP.3.0). Using this object when I try to send a request application throws an "Access is Denied" error. Strange thing...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.