Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27355

VS 2008 Compare Two Times, Plus a "Delay"

$
0
0
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.

Viewing all articles
Browse latest Browse all 27355

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>