In article <et**************@tk2msftngp13.phx.gbl>, George D. Lake wrote:
Hi,
I have a Windows Service in VB.NET and now I need to send a message to
it from a different PC. How can I do this in a very simple way? (No SQL or
other external way), I need to talk directly to the service.
Thanks.
George.
Well, there are a couple of things you can do... The first, and
probably simplist way is to make use of the ServiceController class.
You can get a reference to the service through the constructor:
Imports System.ServiceProcess
....
Dim controller As New ServiceController ("servicename", "machinename")
This will let you use the ExecuteCommand method on the service... The
limitation is that the command is an integer value only. So, if you
need to send additional parameters, you can't really use this method
(unless you can some how encode them into an integer)...
' exectue a custom command on the service
controller.ExecuteCommand (23)
If that won't work for you... There is always Sockets and Remoting as
alternatives.
--
Tom Shelton [MVP]