1. What is Windows service?
Windows service applicationsProgramIt is an application that requires long-term running. It is especially suitable for the server environment. It does not have a user interface and does not produce any visual output. Any user message is written into the Windows event log. When the computer starts, the service automatically starts running. They do not run only when users log on. They can run in any user environment including the system. Through the Service Control Manager, Windows Services are controllable and can be terminated, paused, and started as needed.
2. Create a Windows Service
When the service is started, an entry is registered to a database to indicate that the service has been started. During service running, it regularly creates a database project record at a specified interval. When the service is stopped, the last database record is created. This service automatically registers with the Windows Application log the records when it is successfully started or stopped.
3. Composition of Windows Services
- Dispose-clear any managed and unmanaged Resources)
- Onstart-Control Service Startup
- Onstop-Control Service stop
4. Install Windows Services
To install a Windows service, you must use installutil.exe of. Net framework.exe, or use a file deployment project such as Microsoft Installer (MSI.
5. Add a service Installer
It is not enough to create a Windows Service and only use the installutil program to install the service. You must add a service installer to your Windows Service so that installutil or any other installer can know how your service is configured.
6. Use installutil to install Windows Services
7. debug Windows Services
8. Add a running Windows Service
From: http://www.cnblogs.com/tuyile006/archive/2006/11/27/573654.html