Remote control of cryptomator with c#

My goal is to open a Winforms-Application(c#)
The applications now opens a certain vault and accesses it’s files by accessing the assigned folder with write permission.
When closing the Winforms-Application, the vault should be closed.
Password should be automatically entered by the Winforms app.

Please share a code skeleton for this.