尝试使用此代码获取所选文件的文件路径,同时右键单击 但我收到错误“找不到文件”我很困惑,把%1 请帮助我谢谢!
RegistryKey rKey = Registry.ClassesRoot.OpenSubKey(@"Directory\shell", true);
String[] names = rKey.GetSubKeyNames();
foreach (String s in names)
{
System.Windows.Forms.MessageBox.Show(s);
}
RegistryKey newKey = rKey.CreateSubKey("open");
RegistryKey newSubKey = newKey.CreateSubKey("command");
newSubKey.SetValue("%1",@"C:\Users\system\Documents\Visual Studio 2010\Projects\dg\dg\bin\Debug\dg.exe");
newSubKey.Close();
newKey.Close();
rKey.Close();
static void Main(string[] args)
{
if (args.Length > 0)
{
folderpath = args[0];