I have a windows service that reads from a config file. I need to modify th开发者_JS百科is config file prior to the application starting. How can I create a GUI that would handle the changes to the config file. I know that a service does not have a GUI per se, but I really just need something to modify some strings in the config file and then start the service.
You can open the configuration and manipulate it programatically...
Configuration cfg = ConfigurationManager.OpenExeConfiguration("your path here");
// perform unspeakable acts upon cfg using your GUI
cfg.Save();
Update to elaborate on comments:
Generally when I need to provide a UI for a service, I expose a wcf channel using a net.tcp endpoint, which does not require special priveledges, and write a simple tray icon app to talk to it. Quick and easy compared to previous strategies.
精彩评论