registry
registry
registry
registry
registry
registry registry registry registry registry registry registry registry
registry registry
registry
Go Back  Xtreme Visual Basic Talk > > > registry


Reply
 
Thread Tools Display Modes
  #1  
Old 12-06-2006, 07:37 AM
ADO DOT NET ADO DOT NET is offline
Junior Contributor
 
Join Date: May 2006
Posts: 209
Default registry


I know how can I go through a loop in a registry key:
[vb]
For MyLoop = 1 To My.Computer.Registry.CurrentUser.OpenSubKey("Software\Microsoft\Intern et Account Manager\Accounts").SubKeyCount
...
Next MyLoop
[/vb
But I don't know how can I read the first available sub key.
And also how to move to the next one.
And get its value...
Reply With Quote
  #2  
Old 12-10-2006, 04:55 AM
herilane's Avatar
herilaneregistry herilane is offline
Unashamed geek

Retired Moderator
* Expert *
 
Join Date: Jul 2003
Location: London, England
Posts: 8,988
Default

Subkeys don't have values; they may contain zero or more values. Values have values.

Use RegistryKey.GetValueNames to get the names of all the values under that key. Then use a For Each loop to loop through the value names, and call GetValue for each one, to get its value.
Code:
Dim rkey As Microsoft.Win32.RegistryKey = _ My.Computer.Registry.CurrentUser.OpenSubKey("Software\Skype\Phone\UI\General") For Each keyName As String In rkey.GetValueNames Dim value As Object = rkey.GetValue(keyName) Console.WriteLine(value) Next Console.ReadLine()
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
registry
registry
registry registry
registry
registry
registry registry registry registry registry registry registry
registry
registry
 
registry
registry
 
-->