T
T
TechNOIR2019-01-21 11:33:31
C++ / C#
TechNOIR, 2019-01-21 11:33:31

C#. How to get subfolder name in registry?

Good afternoon.
How can I get the name of a subfolder in the registry?
There is a subfolder under the path HKEY_CURRENT_USER\Control Panel\Desktop\PerMonitorSettings. She's different for everyone. Name or ID of the monitor as far as I understand. I have this kind of SAM0000000000000_00_000_000_0000_0000
How to get her name?
I get to the right moment

RegistryKey currentUserKey = Registry.CurrentUser.OpenSubKey("Control Panel",true).OpenSubKey("Desktop", true).OpenSubKey("PerMonitorSettings", true);

thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sumor, 2019-01-21
@Sumor

GetSubKeyNames will return the names of all subkeys. Choose the one you want and take off.
OpenSubKey can immediately open the path:

Registry.CurrentUser.OpenSubKey(@"Control Panel\Desktop\PerMonitorSettings",true)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question