using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Win32;
public class MainClass{
static void Main(string[] args){
string strKey;
string strSetting;
string strAns;
Console.WriteLine("Enter the key");
strKey = Console.ReadLine();
RegistryKey TestProject = Registry.CurrentUser.OpenSubKey(strKey, true);
Console.WriteLine("Enter the setting");
strSetting = Console.ReadLine();
Console.WriteLine("Do you really mean to delete: " + strKey + "\\" + strSetting + "?");
strAns = Console.ReadLine();
strAns = strAns.ToUpper();
if (strAns == "Y" | strAns == "YES")
{
TestProject.DeleteValue(strSetting);
Console.WriteLine("Key setting " + strKey + "\\" + strSetting + " deleted");
}
else
{
Console.WriteLine("No deletion performed; key closed");
TestProject.Close();
}
}
}