日期:2014-05-17  浏览次数:20810 次

C# 添加程序到指定文件的右键菜单中
比如我定义了后缀名为gzk的文件,在右键点击gzk时,右键菜单中出现我定义的字符串,如“解压gzk”,
而右键不是gzk文件时,不会出现“解压gzk”,下面的代码对所有文件的右键都会出现"解压gzk"

            RegistryKey shell = Registry.ClassesRoot.OpenSubKey(@"*\shell", true);
            RegistryKey custom = shell.CreateSubKey("解压gzk");
            RegistryKey cmd = custom.CreateSubKey("command");
            cmd.SetValue(string.Empty, sFullName);
            cmd.Close();
            custom.Close();
            shell.Close();

------解决方案--------------------
http://www.cnblogs.com/kingmoon/archive/2011/04/25/2028812.html
里面有