Raysefo

Raysefo

  • 1.4k
  • 284
  • 145.5k

How to make conditional run?

Jan 4 2012 4:32 AM
Hi,

I have a windows form app as follows. I would like to make conditional transactions according to current time.Lets say if time is 11 and minute is between 10 and 15 then do this else do other thing on run time. How can I do it?

Best Regards.

Here is my sample code:

 [STAThread]         static void Main()         {             DateTime td = DateTime.Now;             int hour = td.Hour;             int min = td.Minute;             Application.EnableVisualStyles();             Application.SetCompatibleTextRenderingDefault(false);               if (hour >= 11 && hour < 12 && min >= 10 && min < 15)             {                 Application.Run(new Form1(hour, min));             }             else             {                 Application.Run(new Form1());             }         }


Answers (8)