Click here to Skip to main content
15,914,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
please, can you tell me in this code which namespace is requried?




C#
string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run";//Path of Key,You can specify full path
using (RegistryKey key = Registry.CurrentUser.OpenSubKey(keyName, true))
{
    if (key == null)
    {
        // Key doesn't exist. Do whatever you want to handle
        // this case
    }
    else
    {
        key.DeleteValue("Value");
    }
}
Posted
Updated 13-Feb-12 1:12am
v2

You need mscorlib.dll, add this dll in your references,it will be located in installation directory of VS :)

Right click on references and select add referece,under .Net tab you'll find this DLL
 
Share this answer
 
v2
try this

C#
using System.Security.Permissions;
using Microsoft.Win32;


go thru this link
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900