简体   繁体   中英

Install & control windows Service from Windows forms GUI

I am working on a project where a service which is running in background should be controlled from GUI. User can start/stop service or modify one or more settings from .settings file. I developed GUI and Service as separate projects in same solution. I have an installation project which installs Service as like any other normal installer. Now,
1) Is it possible to combine GUI and service and create a single installation file?
2) Is is possible to have a single setting.settings file for both projects where GUI modifies and Service reads?

For 1) You could add a third "setup and install" project to you two projects, referencing the two other projects and using their output.

For 2) You should make the Service project responsible for the settings file, maybe adding a few 'ServiceManagement' methods and classes to help operate on the settings file, and the GUI should reference the extended Service project, and use the new methods to change the settings file.

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