日期:2014-05-17 浏览次数:20518 次
public partial class test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
t2();
Thread t = new Thread(new ThreadStart(t1));
t.SetApartmentState(ApartmentState.STA);
t.Start();
}
private void t1()//长时间执行
{
int s = 0;
for (int i = 0; i < 100000000; i++)
{
s += i;
}
}
private void t2()
{
for (int i = 0; i < 10; i++)
{
Response.Write(i.ToString());
}
}
}