• λ我爱Aspx >> Asp.Net >> Create and Control Windows Services--Control Your Service[等级:高级]
  • Create and Control Windows Services--Control Your Service[等级:高级]

  • :aspxer  Դ:internet  :2007-5-28 20:37:31  ؼ:
  • Create and Control Windows Services--Control Your Service[等级:高级]

    #ve created your service—now it@#s time to create the service controller. Use the System.ServiceProcess namespace@#s ServiceController class to interface programmatically with the Service Control Manager to start, stop, pause, resume, and send custom commands to any installed service.

    Figure 2 | Keep Your Service Under Control. Click here.

    Connect to a service by supplying its name to the ServiceController constructor and, optionally, specifying the machine name where the service is installed. Once the ServiceController object has been created, controlling the service is as simple as calling the Start(), Stop(), Pause(), and Continue() functions. For instance, start the service you created earlier by passing the name of the service, "File Monitor Service," to the ServiceController constructor and call the Start() function. If you need to retrieve the service@#s current status, you can compare its Status property with the ServiceControllerStatus enumerated type:

    Ҷƪл˵?
  • һƪ测试 XML Web 服务和应用程序(自MS)
    һƪCreate and Control Windows Services--Add File-Monitoring Functionality[等级:高级]