Click here to Skip to main content
15,914,642 members
Home / Discussions / C#
   

C#

 
GeneralRe: Recommend Good books and the C# 3.0, 3.5 Difference Pin
Guhanath22-Feb-08 0:20
Guhanath22-Feb-08 0:20 
GeneralRe: Recommend Good books and the C# 3.0, 3.5 Difference Pin
Colin Angus Mackay22-Feb-08 11:56
Colin Angus Mackay22-Feb-08 11:56 
QuestionHow to align text in Label Pin
D i x y21-Feb-08 18:37
D i x y21-Feb-08 18:37 
AnswerRe: How to align text in Label Pin
Christian Graus21-Feb-08 19:16
protectorChristian Graus21-Feb-08 19:16 
GeneralRe: How to align text in Label Pin
D i x y21-Feb-08 20:11
D i x y21-Feb-08 20:11 
AnswerRe: How to align text in Label Pin
darkelv21-Feb-08 20:08
darkelv21-Feb-08 20:08 
AnswerRe: How to align text in Label Pin
Ravenet22-Feb-08 3:36
Ravenet22-Feb-08 3:36 
GeneralStart a service at a predefined time. Pin
CodingLover21-Feb-08 17:34
CodingLover21-Feb-08 17:34 
Hi all,

I wrote a C# .Net service to automatically do some process in each 10 seconds. Say I start the service at 10:10:10 hours, then process are executed at 10:10:10, 10:10:20, 10:10:30 ......and so on until I stop the service.

But I want to start the service at 10 seconds interval. That is either on 00, 10, 20, 30... seconds time. Not like 11, 34, 56....

In other words, even I start the service manually at anytime my processing should start like times on 10:20:00, 2:45:30, 11:19:50, etc

I think it is clear for you now.

All the things I start from the constructor method. May following code segment helps you...

namespace RfService
{
	public class RfService : System.ServiceProcess.ServiceBase
	{
		public RfService()
		{
			InitializeComponent();

			const double INTERVAL = 10000;	
			TimerTicker = new System.Timers.Timer( INTERVAL );
			TimerTicker.Elapsed += new ElapsedEventHandler( this.ServiceTimer_Tick );
		}

		private void ServiceTimer_Tick( object sender, System.Timers.ElapsedEventArgs e )
		{
                        // Do the processing here
		}
        }
}


Can you guys and gals give me a help to do it. Smile | :)

I appreciate your help all the time...
Eranga Smile | :)

GeneralRe: Start a service at a predefined time. Pin
Christian Graus21-Feb-08 18:28
protectorChristian Graus21-Feb-08 18:28 
QuestionRe: Start a service at a predefined time. Pin
CodingLover21-Feb-08 18:56
CodingLover21-Feb-08 18:56 
GeneralRe: Start a service at a predefined time. Pin
Christian Graus21-Feb-08 19:53
protectorChristian Graus21-Feb-08 19:53 
GeneralRe: Start a service at a predefined time. Pin
CodingLover21-Feb-08 21:37
CodingLover21-Feb-08 21:37 
Questionhow to write auto running program with c# Pin
yellowstone21-Feb-08 17:11
yellowstone21-Feb-08 17:11 
Questionhow to write auto running program with c# Pin
yellowstone21-Feb-08 17:09
yellowstone21-Feb-08 17:09 
GeneralRe: how to write auto running program with c# Pin
Christian Graus21-Feb-08 18:27
protectorChristian Graus21-Feb-08 18:27 
GeneralDisabling of Close Form option Pin
Neo Andreson21-Feb-08 16:19
Neo Andreson21-Feb-08 16:19 
GeneralRe: Disabling of Close Form option Pin
PIEBALDconsult21-Feb-08 16:24
mvePIEBALDconsult21-Feb-08 16:24 
GeneralRe: Disabling of Close Form option Pin
Christian Graus21-Feb-08 16:30
protectorChristian Graus21-Feb-08 16:30 
GeneralRe: Disabling of Close Form option Pin
Neo Andreson21-Feb-08 16:33
Neo Andreson21-Feb-08 16:33 
GeneralRe: Disabling of Close Form option Pin
Christian Graus21-Feb-08 16:54
protectorChristian Graus21-Feb-08 16:54 
GeneralRe: Disabling of Close Form option [modified] Pin
DaveyM6921-Feb-08 23:24
professionalDaveyM6921-Feb-08 23:24 
GeneralRe: Disabling of Close Form option Pin
PIEBALDconsult24-Feb-08 15:58
mvePIEBALDconsult24-Feb-08 15:58 
GeneralRe: Disabling of Close Form option Pin
DaveyM6925-Feb-08 1:05
professionalDaveyM6925-Feb-08 1:05 
GeneralRe: Disabling of Close Form option Pin
PIEBALDconsult28-Mar-08 6:27
mvePIEBALDconsult28-Mar-08 6:27 
NewsCodeForms Lite v4.0 Released (FREEWARE) Pin
Rafael Agundis21-Feb-08 15:24
Rafael Agundis21-Feb-08 15:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.