C#和Windows资源管理器上下文菜单

3
1个回答

1

您需要设置命令以传递相关路径。而不是使用:

// From the related article
regcmd.SetValue("",this.txtPath.Text);  

你应该能够使用:

string command = string.Format("\"{0}\" \"%1\"", this.txtPath.Text);
regcmd.SetValue("", command);  

这将构建一个命令字符串,其中包括您的可执行文件路径(this.txtPath.Text),后面跟随触发上下文菜单时使用的选定项(%1)。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接