+ Reply to Thread
Results 1 to 2 of 2

Thread: creating / deleting a RegistryKeys

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    35

    creating / deleting a RegistryKeys

    I just want to learn how to deal with Windows32 RegistryKeys .
    Like Creating and deleting registry keys.

    Can you tell me how to do that ?
    Last edited by boss91; 11-11-2012 at 10:51 AM.

  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    35
    Create a RegistryKey : [A software RegistryKey for example]
    Code:
    RegistryKey rk = Registry.LocalMachine.CreateSubKey("SOFTWARE\\TEST");
    rk.SetValue("SUB-KEY", "TESTVALUE");
    rk.Close();
    Now open regedit and check LOCAL_MACHINE\SOFTWARE\TEST

    Delete a RegistryKey : [the one we just created for example]
    Code:
    RegistryKey delete = Registry.LocalMachine.OpenSubKey("SOFTWARE", true);
    delete.DeleteSubKeyTree("TEST");
    delete.Close();
    Noticed that i deleted TEST only as DeleteSubKeyTree will delete the subkey and everything related to it.

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts