private const string SessionKey="Default";
protectedvoidPage_Load(object sender, EventArgs e)
{
string startHTML="HTML PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" + Environment.NewLine+"" + Environment.NewLine+"
"+Environment.NewLine+""+Environment.NewLine+""+Environment.NewLine;startHTML+=newString('',1024)+Environment.NewLine;
Response.Write(startHTML);
Response.Flush();if(Session[SessionKey]!=null)
{
Hashtable ht=(Hashtable)Session[SessionKey];
Session[SessionKey]=null;
Output(ht);
}
string endhTML=Environment.NewLine+""+Environment.NewLine+"";
Response.Write(endhTML);
Response.Flush();
}
privatevoidOutput(Hashtable ht)
{if(ht.ContainsKey("post")&&ht["post"].ToString()=="true")
{
string js="
int count = 0;
int.TryParse(ht["count"].ToString(), out count);
Response.Write("开始
");Response.Flush();for(inti=0; i
{
Response.Write(string.Format("正在处理第 {0} 次……", i+1));
Response.Write(js);
Response.Flush();
System.Threading.Thread.Sleep(1*1000);
Response.Write("完成
");
Response.Flush();
}
Response.Write("结束
");
Response.Write(js);
Response.Flush();
}
}