怀疑我的Windows应用程序

问题描述:

我的win应用程序我有一个按钮(button1),如果我们点击button1它应该更改注册表值并右键单击隐藏发送到选项。
下面的代码正常工作在Windows XP中,但在Windows7中不起作用。


为什么它不适用于Windows7&请给我正确的编码

I my win app i had a button(button1), if we click the button1 "it should change the Registry Value" and hide "Send To" option in right click.
The Below Code is working in Windows Xp but not working in Windows7.

Why it shouldn't work in Windows7 & Please Give me the proper coding

 private void button1_Click(object sender, EventArgs e)
        {
            DeactivateSendTo();
        }
public void DeactivateSendTo()
        {
            string root = "AllFilesystemObjects\\shellex\\ContextMenuHandlers\\Send To";
            RegistryKey rKey = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(root, true);
            rKey.SetValue("", "");
            rKey.Close();
        }

在(以管理员身份运行)下运行应用程序
Run the application under(Run as Administrator)