// Declare variable of type String.
String strGreeting;
// Declare variable of type DateTime.
DateTime now = DateTime.Now;
void Page_Load ( Object Src, EventArgs E ) {
// Check for am/pm and output appropriate message.
if ( now.Hour >= 12 ) {
if ( now.Hour >= 18 )
strGreeting = "Good Evening.";
else
strGreeting = "Good Afternoon.";
}
else {
strGreeting = "Good Morning.";
}
}