Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7784625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:07:28+00:00 2026-06-01T20:07:28+00:00

Microsoft.Win32.RegistryKey registryPath = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@SOFTWARE\Wow6432Node\Testing); Microsoft.Win32.RegistryKey entryKey = registryPath.OpenSubKey(Entry Point); I have a lot of

  • 0
Microsoft.Win32.RegistryKey registryPath = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Wow6432Node\Testing");

Microsoft.Win32.RegistryKey entryKey = registryPath.OpenSubKey("Entry Point");

I have a lot of keys in Testing, in the format: “Entry Point 011”, “Entry Point 123” – so Entry Point with random numbers after it.

Would I be able to search the registryPath variable above and get a count of the number of keys containing the “Entry Point” keyword? Assuming that there are also other keys existing without this keyword.

At the moment I have been using a for loop and looping for all possible combinations to get a count of all the keys, checking if the key exists or not, but as there are keys as high as “Entry Point 9000” having a for loop execute 9000 times is very inefficient.

 for (int i = 0; i <= highestEntryPointValue; i++)
 {
     Microsoft.Win32.RegistryKey entryKey = steamApps64.OpenSubKey("Entry Point " + Convert.ToString(i));

     if (entryKey != null)
     {
         count++;
     }
 }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:07:30+00:00Added an answer on June 1, 2026 at 8:07 pm

    Microsoft.Win32.RegistryKey has a method called GetSubKeyNames() which returns an array of string with names.

    string[] keys = registryPath.GetSubKeyNames();
    

    now you can loop on these keys and check their name without opening in vain the registry

    var subKeys = Array.FindAll(keys, key => key.Substring(0, 11) == "Entry Point"));
    int count = subKeys.Lenght;
    foreach(string s in subKeys)
    .....
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my code: Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@SOFTWARE\ADM); The registry entry exists on the machine.
string registryKey = @SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall; using (Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(registryKey)) { (from a in key.GetSubKeyNames()
Do OpenSubKey() and other Microsoft.Win32 registry functions return null on 64-bit systems when 32-bit
I am adding a registry key using the following code: var key = Microsoft.Win32.Registry.LocalMachine.CreateSubKey(key);
I can get/set registry values using the Microsoft.Win32.Registry class. For example, Microsoft.Win32.Registry.SetValue( @HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run, MyApp,
I don't know what's going on here... but the Microsoft.Win32.Registry class is returning all
I have a DLL with the following code using System.Text; using Microsoft.Win32; using System.Diagnostics;
I have a DLL with the following code using System.Text; using Microsoft.Win32; using System.Diagnostics;
We have a Microsoft.Win32 Namespace but is it guaranteed to work in 64-bit Windows
I am trying to read registry keys from folder HKLM\SOFTWARE\Microsoft.NETFramework\v4.0.30319 Folder contains two keys

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.