问题
I want to set in the right-click menu of windows, a shortcut to my app. The goal is to select a document (image, pdf etc.) -> right-click -> 'Send with my app' ( and optionnaly open a certain class with arguments, like the files path)
I've saw some many possibilities to do that ...
but I would like to know the good way to do that with a c# wpf app.
The goal is to send an installation program to many clients to allow them to use the app, and set the entry on the context menu
回答1:
In order to show custom options in Windows context menu, you will need to update the registry. Here is how to do it
http://www.howtogeek.com/107965/how-to-add-any-application-shortcut-to-windows-explorers-context-menu/
Once done, in your wpf application, you can get the command line arguments passed using :
string[] args = Environment.GetCommandLineArgs();
from these args, you can extract any argument passed (file location etc)
来源:https://stackoverflow.com/questions/34176448/c-sharp-wpf-set-link-in-the-right-click-context-menu-of-windows