I am using directory services to get the last date the user changed his password. If this date was within 5 minutes I want to show a particular webpage when the user logs in. So for example a user gets prompted to change password. Rigth after changing windows password they login, because the change was within the 5 minute time frame the user will be presented with say google.com. If the user logs off and logs back in tomorrow nothing would happen. Here are some ideas I had but don’t work.
if(datepasswordchanged < datepasswordchanged.AddMinutes(5))
However this would happen everytime.
I also had
if(DateTime.Now.AddMinutes(-5) == datepasswordchanged)
however this would only happen if it was exactly 5 minutes ago. How could I specify a range?
will be “If current time is less than five minutes after time in variable.”