CSDN博客

img bgu

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

发表于2004/9/21 19:41:00  697人阅读

<%@ 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>
0 0

相关博文

我的热门文章

img
取 消
img