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 6044601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:01:49+00:00 2026-05-23T07:01:49+00:00

what i am trying to do is to have multiple user names and folder

  • 0

what i am trying to do is to have multiple
user names and folder paths in one key.

so i have this structure

HKEY_LOCAL_MACHINE

— SOFTWARE

— XYZ

— userDB

now in userDB i have the info like this

> NAME    TYpe   Data
> 
> Admin  Reg_sz  C:\Desktop
> 
> Admin2 REG_SZ  C:\xyz\logs

how can i read the values in userDB…

any suggestions.. thanks

i tried this code:

            RegistryKey masterKey = Registry.LocalMachine.CreateSubKey("SOFTWARE\\xyz");
        if (masterKey == null)
        {
            //Console.WriteLine("Null Masterkey!");
        }
        else
        {

            table.Rows.Add(false, masterKey.GetValue("userDB"), DateTime.Now);
            dataGridView2.DataSource = table;
            //Console.WriteLine("MyKey = {0}", masterKey.GetValue("userDB"));
        }
        masterKey.Close();

but i get the error
Access to the registry key ‘HKEY_LOCAL_MACHINE\SOFTWARE\xyz’ is denied.

  • 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-05-23T07:01:49+00:00Added an answer on May 23, 2026 at 7:01 am

    While you talk about reading values in your topic, your code actually writes to the registry.

    You can’t write to most of the HKLM part of the registry by default as a limited user. A limited users may not destroy/manipulate these keys because that’s a security risk.

    You could have your setup program(running with admin privs) change the permissions for your shared registry key. But that’s bad style, and I wouldn’t do it.

    When using asp.net there might be additional restrictions related to the medium trust model.

    You have:

    RegistryKey masterKey = Registry.LocalMachine.CreateSubKey("SOFTWARE\\xyz");
    

    RegistryKey.CreateSubKey is documented as:

    Creates a new subkey or opens an existing subkey for write access.

    Opening for write access most likely requires write privileges.

    RegistryKey.OpenSubKey is used to open a key for read access. So it most likely requires no writing privileges.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple tables in a mysql database and I am trying to put
I am currently trying to communicate a parent process which should have multiple children
so i'm trying to set up an application where i have multiple panels inside
I am trying to have a tooltip on multiple lines. how do i do
I have the following SQL statement where i'm trying to update multiple rows matching
I have a form with multiple dropdowns consisting of multiple values. I'm trying to
I have a Django app and I am trying to perform transactions over multiple
I have a hashmap that contains multiple string arrays. I am trying to output
I am trying to upload multiple images and I have a jquery plugin set
I am trying to create a multiple image uploader and I have come across

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.