Control application for a windows service (best practice)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cato

    Control application for a windows service (best practice)

    How can i interact with a windows service written in c#?

    i'm developing a software that monitor file creation activity, it does
    work well.. it "logs" all my events and executes custom actions on
    file creation.

    How can i create a windows form application that interacts with my
    service and let me see "real time" events?

    Or... how can i query my windows service for a certain variable or
    object??

    I saw i can crfeate a OnCustomCommand event and control it with a
    ServiceControll er class.. but the ExecuteCommand () method is a VOID
    method.


    thank you
  • =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?=

    #2
    RE: Control application for a windows service (best practice)

    I did this a while ago and setup a remoting server inside the service and
    connected to that from the client. The server then raised events or returned
    things from method calls to indicate the state of the service.
    I guess now the best practice to this approach would be to use WCF rather
    than remoting.
    --
    Ciaran O''Donnell



    "Cato" wrote:
    How can i interact with a windows service written in c#?
    >
    i'm developing a software that monitor file creation activity, it does
    work well.. it "logs" all my events and executes custom actions on
    file creation.
    >
    How can i create a windows form application that interacts with my
    service and let me see "real time" events?
    >
    Or... how can i query my windows service for a certain variable or
    object??
    >
    I saw i can crfeate a OnCustomCommand event and control it with a
    ServiceControll er class.. but the ExecuteCommand () method is a VOID
    method.
    >
    >
    thank you
    >

    Comment

    • helen

      #3
      try this.

      you can pass in parameters in your windows application's main function.

      Comment

      Working...