c# - Exit my while loop at a specific day and time -
i have while loop continually processing information on weekend. on monday @ 8:00 process stop.
i have running inside while loop:
datetime currentdate = datetime.now; if (currentdate .dayofweek == dayofweek.monday) { runloop = false; }
this should correctly stop loop turns monday right?
how enable continue until 8:00 on monday morning?
it sounds me it's simple as:
datetime currentdate = datetime.now; if (currentdate.dayofweek == dayofweek.monday && currentdate.hour >= 8) { runloop = false; }
Comments
Post a Comment