V
V
Vyacheslav2018-01-05 12:25:37
C++ / C#
Vyacheslav, 2018-01-05 12:25:37

How to implement "open with" in C#?

Created a couple of applications for working with text and images. When I run them through "open with" it just appears a new file. How can I write that would immediately open the selected file?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Yudakov, 2018-01-05
@ShamanSBubnom

Environment.GetCommandLineArgs()

P
Peter, 2018-01-05
@petermzg

Use an application like process explorer that allows you to view startup options and run "open with" again.
You will clearly see that the command line will be of the form:
".exe" ".ext"
And already in your application process the command line input parameters.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question