I have OpenFileFialog realized in my Windows Forms application, but when I use Open With in file context menu, or add my item in context menu with command like "myapp.exe %1" it just opens application. Need I to do anything else to realize it?

有帮助吗?

解决方案

This does nothing more than pass a filename as the first argument to your program. Just having an OpenFileDialog is completely irrelevant to that. You need to examine command-line arguments at startup and decide that you might want to open a file if one is given.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top