Windows Service Development and Application

Source: Internet
Author: User

Windows service runs on the system background without a graphical user interface. You can manually start the service as the system starts automatically or after the system starts. Since it is always running in the background, it gives a sense of behind-the-scenes hero and obscurity. But sometimes the service is very useful.
For example, if our company is engaged in system integration, after the device debugging is complete, the data collected by the device needs to be transmitted to another company's data processing platform in real time, requiring real-time data transmission. It is best to think about making a Windows service. As long as the system starts, the service runs automatically without manual intervention.

 

Architecture:

1. ServiceProgram

To meet the business needs of the system.

2. service control procedures

Control the start, stop, pause, and continue of a service.

3. service configuration program

The configuration program can install services, register services with the Registry, and set the Service Startup type, service users, and dependencies.

After clarifying the architecture of Windows service, it is very easy to create a service.

 

Service creation steps:

1. Add project-Windows Service (eg: service1)-Development of service programs to.

2. Right-click the service1 designer and choose add installer to configure

3. Install the service

 

In step 1, design and develop the [Service Program] in the corresponding architecture, and implement the functions required by the system.

The installer added in step 2 is the service control program and service configuration program in the object architecture]

In step 3, install installutil.exe, the next Installation tool of the. NET Framework, to install the service: installutil.exe service name; uninstall the service: installutil/u service name

 

In step 1, the development of the service program involves debugging issues. In my opinion, the simple and practical method is to addCodeCopy to service. CS.

Step 2: You can configure service-related attributes and control information on the visual interface, and write code for simple service control, which improves development efficiency.

 

When I first started writing services, I didn't quite understand it. It was not easy to do. After I finished writing, I felt I had understood a lot. I wanted to make a summary and couldn't write much, so I had to continue learning.

A cool man wrote an article with an example: C # developing a Windows Service Program

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.