Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在我的 Windows 窗体应用程序中实现了 OpenFileFialog,但是当我在文件上下文菜单中使用打开方式,或者使用“myapp.exe %1”之类的命令在上下文菜单中添加我的项目时,它只会打开应用程序。我需要做任何其他事情来实现它吗?
这只是将文件名作为第一个参数传递给您的程序。仅仅拥有一个 OpenFileDialog 与此完全无关。您需要在启动时检查命令行参数,并决定是否要打开一个文件(如果有的话)。