//Adding New Key
RegistryKey key = Registry.LocalMachine.OpenSubKey("Software", true);
// Create a sub key
RegistryKey newSubKey = key.CreateSubKey("Sample RegSubkey");
// Set value of sub key
newSubKey.SetValue("Sample RegSubkey", "I have Created New VAlue");
// Retrieve data from other part of the registry
RegistryKey NewKey = Registry.LocalMachine;
NewKey = NewKey.OpenSubKey("HARDWARE\\\\DESCRIPTION\\\\System\\\\CentralProcessor\\\\0");
object val = NewKey.GetValue("VendorIdentifier");
// Delete the key value
RegistryKey delKey = Registry.LocalMachine.OpenSubKey("Software", true);
delKey.DeleteSubKey("Sample RegSubkey");
Thursday, July 30, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment