C#
  Home arrow C# arrow Page 2 - Timer Objects in Windows Services with C#....
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
C#

Timer Objects in Windows Services with C#.NET
By: Rogier Doekes
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 157
    2004-10-18

    Table of Contents:
  • Timer Objects in Windows Services with C#.NET
  • Setting up the Project
  • Adding Code
  • Coding the Windows Service Start and Stop Event Handlers
  • Building and Installing the Service

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Timer Objects in Windows Services with C#.NET - Setting up the Project


    (Page 2 of 5 )

     
    1. Create a C# Windows Service project and name it TimerSrv.

    Doekes


    The project will come with a class, Service1.cs. Double-click Service1.cs in the project explorer to reveal the properties. Name the service TimerSrv and in the ServiceName field also fill in TimerSrv.

    Doekes

    2. Next we are going to add an installer to the project. Click on the hyperlink Add Installer. A design screen will be added to the project with 2 controls: serviceProcessInstaller1 and ServiceInstaller1.

    3. Click the serviceProcessInstaller1 control and, in the properties dialog, change the account to LocalSystem.

    Doekes

    4. In the serviceInstaller control, change the start type to Automatic, and give it a nice display name, like Timer Service.

    Doekes


    More C# Articles
    More By Rogier Doekes


       · Thanks! Your article was quite helpful, however i couldn't find the "add installer"...
       · Thanks this is the best and simplest article on the usage of timers
       · You can find the AddInstaller option by right click on the properties window where ...
       · This was the best and simple example which I used it to make my first Service....
       · hi, Thanks for your Article. This one is so good to know about the windows service...
       · Heya! This really helped me, as well! Thing is, I got it all to compile & work,...
       · This really helped me a lot to know what the windows services are.
       · Have the same problem. Does anybody knows what the problem is?
       · Your article is very helpful.Hovever, please note that the exe file has been...
       · 1. Manually create the text file (don't trust the program to do it)2. Right click...
       · Go to Design page and right click on disign page u will see the option add...
       · God bless you for posting this neat example. Thanks a lot !!
       · Could not start Timer Service service on local computer.Error 5: access...
       · Is your property serviceProcessInstaller1>Account set to 'LocalSystem'? If set to...
       · Hello, I get the same problem. I am unable to start the service, it tells me that...
       · Thank You Very Much...I went through so many articles before this, But I was not...
     

    C# ARTICLES

    - Working with Dates and Times in C#
    - Generics, Dictionaries, and More
    - More About Generics
    - Working with C# Collections
    - Generics
    - C# and XML
    - Pointers and Arrays in C#
    - C# 3.0 Extension Methods
    - Overloading Operators in C#
    - Iterators and Nullable Types
    - Patterns and Iterators in C#
    - C# Exceptions
    - Methods in C#
    - Delegates and Events in C#
    - Advanced C#

     
    Best Practices for Windows Vista Migration Presentation
    Dell and Microsoft recently held a series of face-to-face seminars entitled, &qu....

     
    Creating a Culture for Code Reuse
    If you oversee development teams you know that like it or not proprietary and ex....

     
    Keys to Web Application Acceleration: Advances in Delivery Systems
    Accelerate Web apps by up to 5x. Ensure significantly faster access to the Web a....

     
    Optimizing Application Monitoring
    Tired of finding out from your customers that you're offline? This white paper e....

     
    Solaris to Solaris Migration -- Migrating applications from Sun SPARC to Dell PowerEdge R900
    This comprehensive Migration Guide reviews the approach that Principled Technolo....

     




    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT