<HTML>
<HEAD>
<title>第二讲：根据时间的不同给出不同的问候语句</title>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 7.0">
</HEAD>
<BODY>

<script language="C#" runat="server">

void Page_Load(object sender,EventArgs e){

		if (DateTime.Now.Hour < 12) 
	{ 
        		Label1.Text="亲爱的读者，上午好";
       	} 
		else if (DateTime.Now.Hour >= 12 && DateTime.Now.Hour < 18)
	{
             		Label1.Text="亲爱的读者，下午好";
       	} 
		else 
			Label1.Text="亲爱的读者，晚上好";

}

</script>

<form runat="server">

	<asp:Label id="Label1" runat="server"/>
	
</form>

</BODY>
</HTML>
