本帖最后由 青菜白汤 于 2013-12-29 13:30 编辑
代码:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Threading;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void demo() {
for (int i = 1; i <=10; i++)
{
TextBox1.Text = Convert.ToString(i);
Thread.Sleep(1000);
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Thread th = new Thread(new ThreadStart(demo));
th.Start();
}
}
运行之后 文本框只显示 1
请问如何让文本框 每隔一秒 显示 1 2 3 4 5 6 7 8 9 10,是添加计时器么,还怎样呢?
|