Reputation: 11
I need a good and easy way to "Talk" to a windows service in C# I have been able to create a windows service and start, stop, pause and continue it using a windows forms application. My question is Which is better and/or easier to accomplish this? WCF or Named Pipes? Or is it easier to do it using a file and make the service check it after some interval continuously? I am very unfamiliar with both concepts(wcf and named pipes). So basically what i am asking is: Which is worth my time? WCF or Named Pipes? Thank you in advance :)
Upvotes: 0
Views: 431
Reputation: 2495
Ok, just provide a simple interface in c# with the following codes for doing what you wanted start,stop,restart
etc
http://www.csharp-examples.net/restart-windows-service/
additionally, you may want to look into
SC
commands which are specifically a way to interact with windows services..
http://msdn.microsoft.com/en-us/library/windows/desktop/ms682107(v=vs.85).aspx
or even WMIC
for remote access
http://msdn.microsoft.com/en-us/library/ms186146%28v=VS.80%29.aspx
Upvotes: 1