Every time you turn on your computer, Windows XP starts more than 80 services, and the average user knows little about these services running in the background. What exactly do they do? Do I really need all of these services? This tutorial will show you which services are required to run and which services do not have to be running. Start our first intimate contact with the windows service.
In many applications, you need to do windows services to operate the database, such as
(1) some very slow database operations I don't want to do it all at once, I want to do it slowly through the service timing, such as timing database backup, etc.
(2) Using windows service to do Host
in .net Remoting Vs.net we can build its windows service in a few minutes, very simple
Let's talk about the steps
1. Create a new project
2. From one available Select Windows Service from the list of project templates
3. The designer opens in design mode
4. Drag a Timer object from the component table of the toolbox onto the design surface (note: Be sure to use Timer from the list of components instead of from the Windows Forms list.
5. Set the Timer property, Interval property 200 milliseconds (5 times database operation in 1 second)
6. Then add the function for this service
7. Double-click this Timer. Then write some database operation code inside, such as
SqlConnection conn=new SqlConnection("server=127.0.0.1;database=test;uid=sa;pwd=275280");
SqlCommand comm=-new SqlCommand("insert into tb1 ('111',11)",conn);
conn.Open();
comm.ExecuteNonQuery();
conn.Close();
8. Switch this service to Design View
9. Right-click on Design View and select “Add Installer”
>
10. Switch to the design view of the ProjectInstaller you just added
11. Set the properties of the serviceInstaller1 component:
1) ServiceName = My Sample Service
2 StartType = Automatic
12. Set the properties of the serviceProcessInstaller1 component Account = LocalSystem
13. Change the path to the bin\\Debug folder where your project is located (if you Release mode compilation is in the bin\\Release folder)
14. Execute the command “InstallUtil MyWindowsService.exe&rdq Uo; register this service to make it a suitable registry entry. (InstallUtil this program in the WINDOWS folder \\Microsoft.NET\\Framework\\v1.1.4322 below)
15. Right click on the desktop “My Computer", select “Manage” Management Console
16. In the "Services & Applications" section of the "Services and Applications" section, you can find that your Windows service is already included in the service list
17. Right click on your service and select Start to start your service.
The crux of the problem is that we can't do without these services. Many of the features of Windows XP are implemented through these services. Simply put, you can think of these services as programs that perform system tasks in the background, such as getting automatic updates or managing print jobs. The biggest difference from the general application is that they all run in the "background", so you basically don't feel their existence.
There is no longer a brilliant xp system. There are always things that cause us hea
Although Microsoft is now launching the Edge browser, there are still many friends
Many people still like to use Windows XP system, but there is often a problem that
The use of WinXP partners often need to use the task manager, because the instability of WinXP is ea
How to modify the spacing of WinXP desktop icons
System tutorial farewell memory read and write error
WinXP start menu style can not be changed solution
XP System Boot Item Optimization Settings
Tips for skipping passwords to log in to WinXP
How to set up WinXP two computers to share a printer? How to set up two computers to share printers
How to solve the system error of Windows XP system IP address conflict?
WinXP advanced startup options feature introduction
How to install XP on a pre-installed Vista PC and set up dual boot?
How to solve the problem that WinXP CCB Network Silver Shield is not recognized?
How does WinXP set up the iis server? WinXP iis server setup tutorial
WinXP in the lower right corner prompts to delay write failure how to deal with
Common shortcuts under the Linux command line
How to disable Win7 Open IE appears to be the default browser prompt
Introduction to the three major application skills of the control panel in Win7 system
QQ HD 1.3 officially released: slide out QQ
DNF God's Tomb Activity Contents and Awards Description
Win7 system blue screen failure 0x0000007f solution
Forget WinXP user passwords with script recovery
Fun Win10 desktop tips Create a high-powered Win10 desktop effects tutorial
How does the VideoStudio feature use the overlay track function? Overlay Rail Function Introduction
How to view hidden files under Win10 system is not visible by default.