Posted By

acosonic on 07/08/10


Tagged

registry win32


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

omayhemo
khouser
Tyster
Priestd09


C# registry read-write


 / Published in: C#
 

  1. Put this at top
  2. using Microsoft.Win32;
  3.  
  4. Read key
  5. RegistryKey regKey1 = Registry.LocalMachine.OpenSubKey("SOFTWARE\\test\\Preferences");
  6. string test = (string)regKey1.GetValue ("TestProperty");
  7.  
  8. Write key
  9. RegistryKey masterKey = Registry.LocalMachine.CreateSubKey("SOFTWARE\\test\\Preferences");
  10.  
  11. masterKey.SetValue("TestProperty", "32");
  12.  
  13. masterKey.Close();

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Vordreller on July 8, 2010

This isn't C#, it's VB.

You need to login to post a comment.