Re: How to pass parameter from a front-end GUI to a windows service?
- From: "Josip Habjan" <jhabjan@xxxxxxxxxxxxxxx>
- Date: Mon, 13 Jun 2005 10:45:38 +0200
Hi,
Basicly what you need is IPC (Interprocess communication) ..
....to accomplish that you could use NamedPipes .. or Remoting .. or TCP/IP
protocol ...
I wroted library on that topic (IPC for .NET):
http://www.habjansoftware.com/ipc_library.aspx
.... it contains IPCServer and IPCClient (and also PipeSender and
PipeReceiver) .. all based on NamedPipes ...
Regards,
Josip Habjan
URL: http://www.habjansoftware.com
"eedych" <eedych@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BEFD4C72-AB44-4963-95BF-CFCBCAF963C9@xxxxxxxxxxxxxxxx
> Hi all,
> as a newbie of C#, I am rather surprised when I saw that the method of
> System.ServiceProcess.ServiceController - ExecuteCommand(int command) -
> has
> only one parameter. What shall I do if I want to send other data contained
> in
> a front-end GUI, say a windows form, to my windows service (could be on a
> remote host)? Following is my code snipper,
> -------------------------------------------------------------
> In MyGui.cs:
> private void buttonFind_Click(object sender, System.EventArgs e)
> {
> try
> {
> serviceController1.ExecuteCommand(129);
> labelInfo.Text = "Execute command";
> }
> catch (System.InvalidOperationException exp)
> {
> MessageBox.Show(exp.ToString());
> }
> }
> --------------------------------------------------------------
> In MyService.cs:
> protected override void OnCustomCommand(int command)
> {
> switch (command)
> {
> case 129:
> cmd129Handler();
> break;
> ....
>
> The function cmd129Handler() cannot retrieve parameters from MyGui.
> Any ideas or suggestions? Thanks in advance!
.
- Follow-Ups:
- References:
- Prev by Date: Re: question about oleDbDataReader HasRows properties
- Next by Date: URGENT! Custom Control Event Issue
- Previous by thread: How to pass parameter from a front-end GUI to a windows service?
- Next by thread: Re: How to pass parameter from a front-end GUI to a windows servic
- Index(es):