Click here to Skip to main content
16,016,693 members
Home / Discussions / C#
   

C#

 
GeneralRe: combining number and dateformating in one funcrtion Pin
PIEBALDconsult28-Apr-08 10:43
mvePIEBALDconsult28-Apr-08 10:43 
GeneralRe: combining number and dateformating in one funcrtion Pin
stephan_00728-Apr-08 10:54
stephan_00728-Apr-08 10:54 
GeneralRe: combining number and dateformating in one funcrtion Pin
PIEBALDconsult28-Apr-08 13:54
mvePIEBALDconsult28-Apr-08 13:54 
GeneralSystem.Timers.Timer Pin
geekfromindia28-Apr-08 9:11
geekfromindia28-Apr-08 9:11 
GeneralRe: System.Timers.Timer Pin
som.nitk28-Apr-08 9:14
som.nitk28-Apr-08 9:14 
GeneralRe: System.Timers.Timer Pin
PIEBALDconsult28-Apr-08 9:20
mvePIEBALDconsult28-Apr-08 9:20 
GeneralRe: System.Timers.Timer Pin
Zoltan Balazs28-Apr-08 9:41
Zoltan Balazs28-Apr-08 9:41 
GeneralRe: System.Timers.Timer Pin
Anthony Mushrow28-Apr-08 14:13
professionalAnthony Mushrow28-Apr-08 14:13 
I wouldn't set up a timer with an interval as large as 60 minutes, or any minutes really. If you need to use a timer, set it up to fire every second, and count the time yourself. There's a couple of ways you can check how much time has passed, and here they are:

int counter = 0;

void Timer()
{
   if(counter == (60*60)) {// 60*60 being 1 hour
      its been a hour, omg!
      counter = 0;
   }
}


And i prefer this way, since you don't have to increase a counter yourself

DateTime now = DateTime.Now;
DateTime start = DateTime.Now;
	
void Timer()
{			
   TimeSpan huh = start-now;

   if(huh.Hours >= 1) {
      Its been an hour, again!
      start = DateTime.Now;
   }
}


I'm sure there are other things you can do instead of using a timer, but if you have to...

My current favourite word is: Bacon!
-SK Genius


GeneralRe: System.Timers.Timer Pin
geekfromindia28-Apr-08 16:21
geekfromindia28-Apr-08 16:21 
GeneralWindows forms and animated gift progress Pin
Saamir28-Apr-08 8:34
Saamir28-Apr-08 8:34 
GeneralRe: Windows forms and animated gift progress Pin
Christian Graus28-Apr-08 11:20
protectorChristian Graus28-Apr-08 11:20 
GeneralRe: Windows forms and animated gift progress Pin
Saamir28-Apr-08 11:31
Saamir28-Apr-08 11:31 
GeneralRe: Windows forms and animated gift progress Pin
Christian Graus28-Apr-08 12:56
protectorChristian Graus28-Apr-08 12:56 
GeneralRe: Windows forms and animated gift progress Pin
Saamir29-Apr-08 3:35
Saamir29-Apr-08 3:35 
GeneralRe: Windows forms and animated gift progress Pin
wzett29-Apr-08 21:19
wzett29-Apr-08 21:19 
GeneralRe: Windows forms and animated gift progress Pin
Saamir30-Apr-08 2:52
Saamir30-Apr-08 2:52 
QuestionHow to detect system shutdown in process running as different user Pin
icon_st28-Apr-08 8:02
icon_st28-Apr-08 8:02 
GeneralMake sure the typeparam is nullable Pin
Jordanwb28-Apr-08 6:08
Jordanwb28-Apr-08 6:08 
GeneralRe: Make sure the typeparam is nullable Pin
Hesham Amin28-Apr-08 7:38
Hesham Amin28-Apr-08 7:38 
GeneralRe: Make sure the typeparam is nullable Pin
PIEBALDconsult28-Apr-08 8:48
mvePIEBALDconsult28-Apr-08 8:48 
GeneralRe: Make sure the typeparam is nullable Pin
Hesham Amin28-Apr-08 8:52
Hesham Amin28-Apr-08 8:52 
GeneralRe: Make sure the typeparam is nullable Pin
PIEBALDconsult28-Apr-08 9:48
mvePIEBALDconsult28-Apr-08 9:48 
GeneralRe: Make sure the typeparam is nullable Pin
Jordanwb28-Apr-08 9:38
Jordanwb28-Apr-08 9:38 
QuestionHow to run bat file after installation (Setup project in c#) ? Pin
bug_aonz28-Apr-08 6:07
bug_aonz28-Apr-08 6:07 
AnswerRe: How to run bat file after installation (Setup project in c#) ? Pin
Christian Graus28-Apr-08 11:23
protectorChristian Graus28-Apr-08 11:23 

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.