问题
I have a Windows Form where a user can enter data. This data, a complex struct, has to be communicated to a Window Service.
How can I solve this problem in C#?
回答1:
There are four ways to Interact with the windows service.
- Through Windows Registry
- Through WMI
- Through Command
- Through interop
Here you can get more Details.
回答2:
If you Right click on the References section in the solution explorer, you will see a menu item for adding a service reference. Once you set that up, you would just reference the service via the new keyword and its name.
来源:https://stackoverflow.com/questions/19771076/send-data-from-windows-forms-application-to-window-service