Read non-key registry entries using c#.net console application

Iftikhar Haidry 1 Reputation point
2021-09-07T17:01:52.24+00:00

Hi,
I need to read registry entry entries that are not backed by key handles like "Minimum Password Length" using C#. I can see some methods to read the key based entries but can't find anything for non-key entries.
Regards.

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,648 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 83,206 Reputation points
    2021-09-07T17:46:14.707+00:00

    "Minimum Password Length" is got with NetUserModalsGet
    (usrmod0_min_passwd_len from USER_MODALS_INFO_0 structure)

    0 comments No comments

  2. Limitless Technology 39,511 Reputation points
    2021-09-08T08:31:40.447+00:00

    Hello Iftikhar,

    registry entries are properties of keys and, as such, cannot be directly browsed, we need to take a slightly different approach when working with them.

    From my knowledge, it isn't ideal to read registry entry entries that aren't by backed by key handles, it is better to go with the help of key handles

    Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall the operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

    For a further idea about your needs, do follow up the below link

    https://learn.microsoft.com/en-us/troubleshoot/windows-server/performance/windows-registry-advanced-users

    Hope this answers all your queries, if not please do repost back.
    If an Answer is helpful, please click "Accept Answer" and upvote it : )

    0 comments No comments