Been googling but I cant find out how to create a registry key itself, not a subkey string value as is seen in all the tutorials. The registry is like a tree with branches and leaves, I want to create a new branch and add a leaf
|tree
|-branch
| |-my branch
|-branch
Thanks for any help
More info to make it clearer as i’m being pointed to what I dont need 😉
you click on one of the registry keys, next to it is an arrow pointing down, you click it and you get more keys maybe with another arrow pointing down for more ketys, well thats what I’m trying to create a “folder” looking thing. I’m not sure how else I can explain but CreateSubKey does nothing like that for me:
Key = Registry.CurrentUser.CreateSubKey("SOFTWARE\Microsof\game\addons\myaddons");
Now, when I check it there is no folder-like icon named myaddons
Not sure if this is what you are trying to do, but you may use
Registry.SetValue(string keyName, string valueName, object value, RegistryValueKind valuekind)to create Keys/Subkeys and its values.Example
This will create a key in
HKEY_CURRENT_USER\Software\with the namePicrofo Software. Then, creates a subkey in the key we’ve created with the nameSubkeyand sets a value of nameValue Nameand its valueValueof typeString. Finally, creates another subkey inPicrofo Softwarewith the nameAnother Subkeywhich has no specific value.Thanks,
I hope you find this helpful 🙂