Example of a Window Service in the.NET Framework
The topic of this blog is developing Windows services applications. Describe in detail how to use DotNet to develop window services.
Step 1: Create the Project Window Service (.net Framework) and give it a name.
Step 2: You can add “appsetting” to the configuration tags in the app.config file.
Step 3. In service1.cs, go to the page, click the left menu, select view code (F7), and copy the code below.
Step 4. In that life menu, go to the service1.cs page and click “add installer.” Then it has two boxes, the first of which is ServiceProcessInstaller1 and the second of which is ServiceInstaller1.
You can start with the menu. Navigate to the property section using the left menu. Change the name of the account to local system. After that, you can go to the serviceinstaller1 property section and put in a service name like “MyService.” After that, build the project.
Step 5. Click on the window menu and type “cmd” (administrator. After that, type the command
Install command
Example. installutil.exe -i C:\Users\*******\Desktop\Job\WindowService.exe
Uninstall command