c# - Registry CreateSubKey not working and no receiving error -


i did before , simple code. here code

private void button1_click(object sender, eventargs e) {     var k1 = registry.localmachine.opensubkey("software", true).createsubkey("test"); } 

im looking regedit hkey_local_machine-software , wow6432node. cant find test key in there.

my user administrator.

i didnt receive error.

maybe has easy solution im working 45 minutes , cant solve problem. thank helping.

are sure you're looking right thing? registry can fickle thing..

i ran

registrykey k1 = registry.localmachine.opensubkey("software", true).createsubkey("test"); k1.setvalue("my value","here"); 

nothing shows yet in regedit - somethings dont show because depends when read.

however ending app, , running

registrykey k1 = registry.localmachine.opensubkey("software", true).createsubkey("test"); console.writeline(k1.getvalue("my value")); 

shows value there.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -