+ 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?
2 Antworten
+ 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.
+ 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