I have a program that I want to have alert the administrator if the application fails.
On a "settings" page I have a checkbox to enable the alerting, or not.
I also have a field where the user should input a "timeout" for sending the alerts (in minutes), so they won't get hundreds of emails. So, they can enter 5 minutes, 30 minutes, and so on.
When the program errors, I need to
a) Get the Current date/time
b) Read the setting from the registry as to when the last message was sent to the admin (how should I format this when I store it to the registry? DateTime??)
c) Read the setting from the registry, to see what the delay/timeout period is.
Then, I need to compare the two times, factoring in the delay to see if I should send the message.
So, do I need to read b) and the current time in, as DateTime and use the compare function?
If so, How do I take into consideration the check to see if the user-specified delay has passed or not.
If it HAS passed, it should send the email.
If it HASN'T passed, it should do nothing.
On a "settings" page I have a checkbox to enable the alerting, or not.
I also have a field where the user should input a "timeout" for sending the alerts (in minutes), so they won't get hundreds of emails. So, they can enter 5 minutes, 30 minutes, and so on.
When the program errors, I need to
a) Get the Current date/time
b) Read the setting from the registry as to when the last message was sent to the admin (how should I format this when I store it to the registry? DateTime??)
c) Read the setting from the registry, to see what the delay/timeout period is.
Then, I need to compare the two times, factoring in the delay to see if I should send the message.
So, do I need to read b) and the current time in, as DateTime and use the compare function?
If so, How do I take into consideration the check to see if the user-specified delay has passed or not.
If it HAS passed, it should send the email.
If it HASN'T passed, it should do nothing.