I have a windows application and I want any event when user changes the time of that system on which that windows application is opened or running.
How can I get that changed time or specific time or any event of system change of time/date?
You can subscribe to SystemEvents.TimeChanged event.
To subscribe to above event, do the following:
1.Create TimeChanged EventHander.
private void time_Changed(object sender, EventArgs e)
{
MessageBox.Show("Time Changed");
}
2.Add above event handler to SystemEvents.TimeChanged
event.
SystemEvents.TimeChanged += time_Changed;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With