怀疑我的Windows应用程序 [英] Doubt in my windows application

查看:80
本文介绍了怀疑我的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)


这篇关于怀疑我的Windows应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆