c# alarm clock | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 7

c# alarm clock

so i built a "Jarvis" system a few years back and he completely runs my whole house. I have him set up with speech recognition via windows ten! I want to make an alarm system to wake up to but for some reason i cant get the code to recognize the time...? Example: if (time == "8:00 am") { say("Good morning, it is time to wake up") }; i have a whole bunch of other "if" statements set up and i have been using c# for a very long time but just cant seem to get the system time on windows to sync with the code....can anyone assist with this matter?

27th Jan 2018, 3:13 AM
David CHAMPION
David CHAMPION - avatar
2 Respostas
+ 9
I guess you'll need to listen to the Timer's event and perform the checking manually. Otherwise polling from the machine's clock is viable too with an infinite loop but I wouldn't recommend that due to performance issue.
28th Jan 2018, 10:25 AM
Zephyr Koo
Zephyr Koo - avatar
+ 1
hello!I'm you need to use time Eclipse public string Today{ Today = datetime.now.day } public string Time { Time = datetime.now.tolongtime.tostring();} //do timer if (textboxDay.text == Today && textboxTime.text == Time ) { messagebox.show("good morning , it's time to make the app "); } i hope that i helps
20th Jun 2018, 12:13 AM
AHLI ADIB
AHLI ADIB - avatar