|
-
Aug 24th, 2011, 03:36 PM
#1
Thread Starter
New Member
Some keys seem to not exist when reading registry
I am trying to read keys and values from the registry. The keys I am looking for do exist in the registry, but the variable mRegKey is still Nothing after the first line is run.
I have also tried different keys under HKLM\Software, some work and some dont. HKLM\Software\ATI is found but HKLM\Software\Oracle is not (both are shown in regedit).
Code:
mRegKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Stockenstrand\DemoPC", False)
If Not mRegKey Is Nothing Then
mSettingImagePath = mRegKey.GetValue("ImagePath")
mSettingSourceDrive = mRegKey.GetValue("SourceDrive")
mSettingVirtualDrive = mRegKey.GetValue("VirtualDrive")
mRegKey.Close()
End If
---------------------------------------------
>stockenstrand.com_
---------------------------------------------
-
Aug 24th, 2011, 04:20 PM
#2
Re: Some keys seem to not exist when reading registry
I am not sure this is relevant to your situation but there are times that a location is removed and then created later. If you where to try and read the location, key or value during this time that would be correct even thou you saw it in the registry editor. A real world example, Macromedia HomeSite+ keeps sessions stored in (figure 1) while not running and while running the key is destroyed until the editor is closed. Sometime download Process Monitor from Microsoft and watch the hundreds of operations being done in the registry without doing much.
Figure 1
Code:
HKEY_CURRENT_USER\Software\Macromedia\HomeSite+\Restore
-
Aug 25th, 2011, 05:37 AM
#3
Thread Starter
New Member
Re: Some keys seem to not exist when reading registry
No, the entries are static. I have added them myself manually. I have not been able to find any logic (spaces in key names, sub keys etc etc) to why some keys are readable and others doesn't seem to exist.
---------------------------------------------
>stockenstrand.com_
---------------------------------------------
-
Aug 25th, 2011, 06:42 AM
#4
Re: Some keys seem to not exist when reading registry
This google any good? (points here)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|