通过文件关联打开应用程序到特定代码

Open application through file association into specific code

文件关联已添加到系统(称为 .uenc),每当我双击扩展名为 .uenc 的文件时,它都会打开我的应用程序,这很好。但是我需要我的应用程序来检索文件的完整路径和文件名,并将其输入到应用程序内的文本框中。

The file with .uenc extension

I need to enter the file path into the text box next to Browse button.

这是怎么做到的?

您应该像这样将文件与参数占位符关联起来:

yourprogram "%1"

在这种情况下,您将收到文件的完整路径作为参数。 考虑到您应该将占位符用引号括起来以处理路径中的空格。