i have an application which it run specifically based on given time to that application, how do i pass the parameter through App.config,
Ex: My service should run every day 9 clock
datetime Runtime = datetime.today.Addhours(9);
the above line will help the service to specifically on that time, now i need to set my service to run by 9:30 , how do i pass the information to Runtime.
i have tried below way it was not accepted
ex 1) datetime Runtime = datetime.today.Addhours(9) + datetime.today.Addminutes(30);
ex 2) datetime Runtime = datetime.today.Addhours(9);
Runtime = datetime.today.Addminutes(30);
You can use
AddHoursgives you anotherDateTime, so you can call the exact same methods you can call onDateTime.Today.You can also add a
TimeSpan, though:This would have the benefit that you don’t have to separate hours and minutes in your configuration.