删除注册表子项C#

时间:2014-09-15 02:34:24

标签: c# key registry

这是我目前所拥有的,但它只是继续使用catch并且密钥永远不会被删除。

private void button7_Click(object sender, EventArgs e)
    {
        try
        {
               Microsoft.Win32.Registry.LocalMachine.DeleteSubKey(@"Software/Microsoft/Windows/CurrentVersion/Policies");
        }
        catch
        {
            MessageBox.Show("Restrictions already removed. Or there was an error.","Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }

我的代码出了什么问题?

0 个答案:

没有答案