Timer Objects in Windows Services with C#.NET - Building and Installing the Service
(Page 5 of 5 )
Build the executable: Build->Build Solution
In order to install the service we need to use the installutil console command, which comes with the .NET Framework.
Open a command line window by going to Start -> Programs -> Microsoft Visual Studio.Net -> Visual Studio.Net Tools -> Visual Studio.Net Command Prompt, and change to the directory where the executable is located. Enter the following command:
installutil TimerServ.exe
// Whatever you defined the executable
// name to be.

Now the service is installed. To start and stop the service, go to Control Panel -> Administrative Tools -> Services. Right click the service and select Start.
Now the service is started, and you will be able to see entries in the log file we defined in the code.
Conclusion
Creating a timer, using a Windows Service, with Visual Studio.Net is not such a difficult task. This article showed the entire process of creating a timer object and using a Windows Service as the control vehicle.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
|
| · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | | |
|