Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I allow my program to open a file when "Open with" is used?

I have written a word processor in C#. I would like to allow my program to open files when the user right clicks the file and selects "open with" and selects my program. How can I implement such a feature to my program? Currently, the only way the user can open a file is by using the OpenFileDialog.

As of now, if the user chooses to "Open with" and selects my program, it doesn't open up the file that they selected.

What is the best way to implement this feature?

like image 401
Toby Avatar asked May 18 '13 21:05

Toby


1 Answers

"Open With" passes the file name as an argument to the application.

Take a look at the args parameter here.

like image 110
Smurf64 Avatar answered Oct 23 '22 09:10

Smurf64