[我的ASP.net学习历程]Cache和DateTime

类别:Asp 点击:0 评论:0 推荐:
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="gb2312" %>
<Script language="C#" runat="server">
void Page_Load(Object Sender,EventArgs e){
 DateTime NowTime=DateTime.Now;
 DateTime Expires=NowTime.AddSeconds(10);
/*
 比较.ToString()与.ToString("r")有什么不同.
 CreatedStamp.InnerHtml=NowTime.ToString();
 ExpiresStamp.InnerHtml=Expires.ToString();
*/
 CreatedStamp.InnerHtml=NowTime.ToString("r");
 ExpiresStamp.InnerHtml=Expires.ToString("r");
 }
</Script>
<font size="3">
Output Caching For Ten Seconds...
<hr size="1">
OutPut Cache Created:<Font color="red"><b id="CreatedStamp" runat="server"></b></Font>
<br>
OutPut Cache Expires:<font color="red"><B id="ExpiresStamp" runat="server"></B></font>
</font>

本文地址:http://com.8s8s.com/it/it8587.htm