日期:2014-05-18 浏览次数:20709 次
public partial class MainPage : PhoneApplicationPage { int num = 0; // Constructor public MainPage() { InitializeComponent(); } private void button1_Click(object sender, RoutedEventArgs e) { Thread th1 = new Thread(new ThreadStart(GetNum)); Thread th2 = new Thread(new ThreadStart(GetNum)); th1.Start(); th2.Start(); textBlock1.Text = num.ToString(); } private void GetNum() { for (int i = 0; i < 50; i++) { num++; } } }