我想最好在 C# VS12 中制作一个应用程序,并且我想将它附加在右键菜单上,将文件路径作为参数传递,如果我也可以在多项选择中做到这一点,那就太好了。我该如何做到这一点?
2 回答
in the installer of your application you need to add a file extension association. (for development you can test that by registering the extension manually: right click, open with...). the file name that was clicked will be passed to your app as a command line argument (those are the args[] in the main method of you app).
multiple selection is a bit trickier but certainly doable. when your app starts you need to check if you have an instance of the app already running (using a mutex for example) and send a message to that instance with the file name you received.
If you have not worked with context menu handling, you should take a look at this tutorial.
For the file path handling, you could take a look at this image editing example.