How to displaying User Options in a Windows Service
-
How do you display User Options in a Windows Service. I know you can stop/start/pause/restart a service. The is a way to add options to start a windows service. Is there anyway to display these options with out starting the service. John Ingram
-
How do you display User Options in a Windows Service. I know you can stop/start/pause/restart a service. The is a way to add options to start a windows service. Is there anyway to display these options with out starting the service. John Ingram
As you said, you can provide command line arguments in the Services control panel / snap-in. If you need to configure the options in a different way, you could use a Windows Forms application that either uses registry settings or writes on a .config file (or other configuration file) for the service. You can use the
ServiceController
class to start, stop, or pause the service programmatically then. If you want to configure the options while the service is running, you need to use theServiceController.ExecuteCommand
to pass a command identifier. If you need to change more complex options, you can use .NET Remoting over a TCP or HTTP channel.-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----