Created
October 1, 2013 13:31
-
-
Save yemrekeskin/6778480 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| // you can add with key-value logic your applications' configuration info | |
| Registry.CurrentUser.SetValue("ADMIN_USER_PASSWORD", "12*23.CFGR|234"); | |
| Registry.LocalMachine.SetValue("MY_APP_PRODUCT_KEY", "SD34-5TGB-ER98-D95E"); | |
| Registry.ClassesRoot.SetValue("KEY", "VALUE"); | |
| Registry.Users.SetValue("USER_NAME", "DOMAIN\\KUBRA"); | |
| // Let's use our helper class :D | |
| RegistryConfigurator.Write("DATABASE_SERVER_PASSWORD", 12345678910); | |
| // create setting named "HIKEY_LOCAL_MACHINE\\SOFTWARE\\My-Application\\" | |
| var value = RegistryConfiguration.ReadKey("DATABASE_SERVER_PASSWORD"); | |
| if (RegistryConfiguration.DeleteKey("DATABASE_SERVER_PASSWORD")) | |
| Console.WriteLine("deleted value"); | |
| else Console.WriteLine("not deleted value"); | |
| Console.ReadLine(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment