0
protected void Page_Load(object sender, EventArgs e)
{
Response.Buffer = false;
while (true)
{
Response.Write(Delimiter + DateTime.Now.ToString("HH:mm:ss.FFF"));
Response.Flush();
// Suspend the thread for 1/2 a second
System.Threading.Thread.Sleep(500);
}
// Yes I know we'll never get here, it's just hard not to include it!
Response.End();
}
當Response.Flush()被執行,新的網頁被髮送到客戶端 的,而塊將服務器 當新maeeage到達客戶端上運行下去,有爲新數據刷新 繼續保持同一位置的可行性如何?不應該創建新的Page對象嗎?。我不明白這一點