Using Windows Services:
1. New Project--windows Service
2. Write a program in Service.cs
3. Configuration:
3.1. Switch to Design view and select Add Installer
3.2. Switch to the installer ProjectInstaller.cs Design view, right-click the ServiceProcessInstaller component, select Properties, Set account property to LocalSystem
3.3, the basic configuration also has some related properties of the service (service name, description, status, etc.), in the Service.cs Design view properties of the relevant settings, this is not detailed explanation, self-exploration.
4. Installation:
4.1, using the system comes with the InstallUtil.exe program installation,
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe Service.exe Pause
Write the above command as a batch, then execute, and the installation is complete! Pay attention to the path problem!
4.2. Install with SC start system command
4.3, Packaging services
5. Uninstall:
5.1, using installutil.exe/u Uninstall service
5.2. Use SC Delete system command to uninstall the service
Unloading:
Basic configuration and installation of Windows services