简体   繁体   中英

Use external associated file to pass arguments to my application

I have a clickonce enabled C# WinForms application for which I created a file association.
How would I be able to use an external file (associated to my application) to pass arguments to my application? I would like to, with the link, have the application open up a specific form, that exists in the main application.

And also prevent it from opening a new instance if the application is already running?

You can create a Singleton class used by application to read configurations. The you only need to read the file and map info to that class.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM