79651967

Date: 2025-06-03 23:00:24
Score: 1
Natty:
Report link

This works for me, hope it helps.

DateTime currentTime = DateTime.Now;

if (currentTime.Hour >= 5 && currentTime.Hour < 12)
{
    ltWellcome.Text = "Good morning " + strUserName + "!  Welcome to the system";
}
else if (currentTime.Hour >= 12 && currentTime.Hour <= 17)
{
   ltWellcome.Text = "Good afternoon " + strUserName + "!  Welcome to the system";
}
else if (currentTime.Hour >= 18 && currentTime.Hour <= 23)
{
   ltWellcome.Text = "Good evening " + strUserName + "!  Welcome to the system";
}
else
{
   ltWellcome.Text = "Good night " + strUserName + "!  Welcome to the system";
}
Reasons:
  • Blacklisted phrase (1): Good afternoon
  • Blacklisted phrase (1): Good morning
  • Blacklisted phrase (1): Good evening
  • Whitelisted phrase (-1): hope it helps
  • Whitelisted phrase (-1): works for me
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: FAdao