473,405 Members | 2,310 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,405 software developers and data experts.

Registry Problem

I am executing the following line:

RegistryKey reg = Registry.CurrentUser.OpenSubKey("Software\\My
Key\\License\\Settings");

DBPath = (String)reg.GetValue("DBPath");

and it works. However, it is not accessing the HKEY_Current_User key. Its
accessing HKEY_Users...

What gives?

glenn
Nov 17 '05 #1
3 1387
Hi Glenn,

How have you detected the real key accessed is HKEY_Users?
If you used something like SysInternals' RegMon, this might be the correct
result, because HKCU is actually a virtual registry hive the system maps to
HKEY_USERS\{SID}\

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"glenn" <gh******@softeksoftware.com> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
I am executing the following line:

RegistryKey reg = Registry.CurrentUser.OpenSubKey("Software\\My
Key\\License\\Settings");

DBPath = (String)reg.GetValue("DBPath");

and it works. However, it is not accessing the HKEY_Current_User key.
Its accessing HKEY_Users...

What gives?

glenn


Nov 17 '05 #2
Hi Glenn,

How have you detected the real key accessed is HKEY_Users?
If you used something like SysInternals' RegMon, this might be the correct
result, because HKCU is actually a virtual registry hive the system maps to
HKEY_USERS\{SID}\

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"glenn" <gh******@softeksoftware.com> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
I am executing the following line:

RegistryKey reg = Registry.CurrentUser.OpenSubKey("Software\\My
Key\\License\\Settings");

DBPath = (String)reg.GetValue("DBPath");

and it works. However, it is not accessing the HKEY_Current_User key.
Its accessing HKEY_Users...

What gives?

glenn


Nov 17 '05 #3
well, I had to do a search for a unique word I had in the key. It only
found it there. I knew it was there because I had code to determine if the
key was there before it continued and it kept continuing despite me not
seeing they key. after doing the search is when I noticed it down in the
users key.

thanks,

glenn
"Dmytro Lapshyn [MVP]" <x-****@no-spam-please.hotpop.com> wrote in message
news:u$**************@TK2MSFTNGP10.phx.gbl...
Hi Glenn,

How have you detected the real key accessed is HKEY_Users?
If you used something like SysInternals' RegMon, this might be the correct
result, because HKCU is actually a virtual registry hive the system maps
to HKEY_USERS\{SID}\

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"glenn" <gh******@softeksoftware.com> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
I am executing the following line:

RegistryKey reg = Registry.CurrentUser.OpenSubKey("Software\\My
Key\\License\\Settings");

DBPath = (String)reg.GetValue("DBPath");

and it works. However, it is not accessing the HKEY_Current_User key.
Its accessing HKEY_Users...

What gives?

glenn

Nov 17 '05 #4

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

Similar topics

21
by: Kevin Swanson | last post by:
I'm attempting some remote registry manipulation via C#. I've written a test app to simply grab a specified key from a specified hive on a specified machine. The call to OpenSubKey is throwing...
17
by: Sam | last post by:
Hi all If I only want to store screen location and size of my application in Windows Registry, which of the keys should I store this info? A sample code is greatly appreciated. Thank you ...
3
by: Aussie Rules | last post by:
Hi, I want to store some data in the registry, however I have not been able to do this, and think my logic maybe flawed. Firstly I try to open the registry and read in any existing values....
6
by: JOSII | last post by:
Getting a string of boolean value into and out of the registry is no problem. Here's the problem: Although you can place an object into the registry and retreive it, I need to place an ArrayList...
0
by: edurazee | last post by:
I am able to create BoundFields and Footer-rows dynamically like this in my GridView: protected void Page_Load(object sender, EventArgs e) { CreateGridView(); ...
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
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,...
0
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...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.