日期:2014-05-18  浏览次数:20715 次

關于“暫停”
int i=1;
while(i==1)
{
  Console.WriteLine("hello");
  //////
}
我如何能實現每個1秒打印一次hello?謝謝

------解决方案--------------------


int i=1; 
while(i==1) 

Console.WriteLine("hello"); 
Thread.Sleep(1000);
}
------解决方案--------------------
using System.Threading;
------解决方案--------------------
using System.Threading
------解决方案--------------------

private void button3_Click(object sender, System.EventArgs e) 

textBox61.Text="hello"; 
Application.DoEvents();
Thread.Sleep(1000); 
textBox61.Text="hello2"; 
Application.DoEvents();
Thread.Sleep(1000); 
textBox61.Text="hello3"; 
Application.DoEvents();


}//button3_Click