Skip to content

Instantly share code, notes, and snippets.

@yemrekeskin
Created October 1, 2013 13:31
Show Gist options
  • Save yemrekeskin/6778480 to your computer and use it in GitHub Desktop.
Save yemrekeskin/6778480 to your computer and use it in GitHub Desktop.
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